ppvm_vihaco::component
component¶
ppvm_vihaco::component
classCircuitExecutor¶source
ppvm_vihaco::component::CircuitExecutor
Bases: GeneratedComponent, Reset
Rust struct.
Signature
pub struct CircuitExecutor<T: Config, I: TableauIndex, C: SparseVector<Complex64, I>>Fields
| Name | Type | Description |
|---|---|---|
tab | GeneralizedTableau<T, I, C> |
classLossyPauliSumExecutor¶source
ppvm_vihaco::component::LossyPauliSumExecutor
Bases: GeneratedComponent, Reset
Rust struct. LossyPauliSum-backed executor. Same dispatch as `PauliSumExecutor` plus `Loss` / `CorrelatedLoss` channels. The concrete `T` used by the enclosing `Circuit::LossyPauliSum` variant is a `Config` whose `PauliWordType` is `LossyPauliWord` (see `LossyPauliSumConfig`).
classPauliSumExecutor¶source
ppvm_vihaco::component::PauliSumExecutor
Bases: GeneratedComponent, Reset
Rust struct. PauliSum-backed executor (Heisenberg picture). Holds a `PauliSum<T>` and answers the same `CircuitInstruction` vocabulary as `CircuitExecutor`, but without measurement / reset / loss support.
classCircuit¶source
ppvm_vihaco::component::Circuit
Bases: HasInstructionSet, GeneratedComponent, Observe<CircuitEffect>, Reset, Default
Rust enum. Outer `Circuit` enum: backend selector. Picks one of the three inner enums based on `info.backend` at construction time; from there, every per-step call routes outer → inner → executor.
pub enum CircuitVariants
| Name | Type | Description |
|---|---|---|
Tableau | (TableauCircuit) | |
PauliSum | (PauliSumCircuit) | |
LossyPauliSum | (LossyPauliSumCircuit) |
methodlossy_paulisum¶source
ppvm_vihaco::component::Circuit::lossy_paulisum
Signature
pub fn lossy_paulisum(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
info | &PPVMDeviceInfo | |
terms | &[(String, f64)] |
Returns
Result<Self>
Build a LossyPauliSum-backed circuit. Same contract as Circuit::paulisum.
sourcemethodpaulisum¶source
ppvm_vihaco::component::Circuit::paulisum
Signature
pub fn paulisum(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
info | &PPVMDeviceInfo | |
terms | &[(String, f64)] |
Returns
Result<Self>
Build a PauliSum-backed circuit, seeding the state with every term in `terms`. Each `(word, coef)` is added via `state += (word, coef)`; the caller is responsible for having parsed/validated the words against `info.n_qubits` (see `parse_observable_terms` in `composite.rs`).
sourcemethodstate_string¶source
ppvm_vihaco::component::Circuit::state_string
pub fn state_string(&self) -> StringReturns
String
Render the current state. Used by the REPL’s `show` command.
sourcemethodtableau¶source
ppvm_vihaco::component::Circuit::tableau
pub fn tableau(info: &PPVMDeviceInfo) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
info | &PPVMDeviceInfo |
Returns
Result<Self>
Build a Tableau-backed circuit. Tableau init only needs `n_qubits` and `coefficient_threshold` from `info`; no observable required.
sourcemethodtableau_with_seed¶source
ppvm_vihaco::component::Circuit::tableau_with_seed
Signature
pub fn tableau_with_seed(info: &PPVMDeviceInfo, seed: u64) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
info | &PPVMDeviceInfo | |
seed | u64 |
Returns
Result<Self>
Same as Circuit::tableau, but seed the tableau RNG deterministically so a shot is reproducible.
sourceclassLossyPauliSumCircuit¶source
ppvm_vihaco::component::LossyPauliSumCircuit
Bases: Reset
Rust enum. LossyPauliSum-backed inner enum. Identical shape to [`PauliSumCircuit`] but with `LossyPauliWord`-keyed configs so loss-channel methods dispatch.
pub enum LossyPauliSumCircuitVariants
| Name | Type | Description |
|---|---|---|
Bits64 | (LossyPauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>, LossyPauliWord<[u8; N]>>>) | |
Bits128 | (LossyPauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>, LossyPauliWord<[u8; N]>>>) | |
Bits256 | (LossyPauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>, LossyPauliWord<[u8; N]>>>) | |
Bits512 | (LossyPauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>, LossyPauliWord<[u8; N]>>>) | |
Bits1024 | (LossyPauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>, LossyPauliWord<[u8; N]>>>) | |
Bits2048 | (LossyPauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>, LossyPauliWord<[u8; N]>>>) |
methodnew¶source
ppvm_vihaco::component::LossyPauliSumCircuit::new
Signature
pub fn new(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
info | &PPVMDeviceInfo | |
terms | &[(String, f64)] |
Returns
Result<Self>
Build a LossyPauliSum-backed circuit, seeding every term via `state += (word, coef)`. Words must already be validated against `info.n_qubits` by the caller.
sourcemethodstate_string¶source
ppvm_vihaco::component::LossyPauliSumCircuit::state_string
classPauliSumCircuit¶source
ppvm_vihaco::component::PauliSumCircuit
Bases: Reset
Rust enum. PauliSum-backed inner enum (Heisenberg picture). Per Decision 7 of the plan, the size buckets carry `[u8; N]`-storage `ByteFxHashF64` configs (N = 8, 16, …, 256) rather than the tableau's `[u64; N]` configs; bucket labels match the semantic qubit count (`Bits64` = 64 qubits) so the outer enum's dispatch is uniform across backends.
pub enum PauliSumCircuitVariants
| Name | Type | Description |
|---|---|---|
Bits64 | (PauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>>>) | |
Bits128 | (PauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>>>) | |
Bits256 | (PauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>>>) | |
Bits512 | (PauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>>>) | |
Bits1024 | (PauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>>>) | |
Bits2048 | (PauliSumExecutor<ByteFxHashF64<N, CombinedStrategy<CoefficientThreshold, MaxPauliWeight>>>) |
methodnew¶source
ppvm_vihaco::component::PauliSumCircuit::new
Signature
pub fn new(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
info | &PPVMDeviceInfo | |
terms | &[(String, f64)] |
Returns
Result<Self>
Build a PauliSum-backed circuit, seeding the state with every term: `for (word, coef) in terms { state += (word, coef); }`. Words must already be validated against `info.n_qubits` by the caller.
sourcemethodstate_string¶source
ppvm_vihaco::component::PauliSumCircuit::state_string
classTableauCircuit¶source
ppvm_vihaco::component::TableauCircuit
Bases: Reset
Rust enum. Tableau-backed inner enum (Schrödinger picture). Carries the six size-bucketed `CircuitExecutor` variants; bucket is picked from `n_qubits`.
pub enum TableauCircuitVariants
| Name | Type | Description |
|---|---|---|
Bits64 | (CircuitExecutor<Byte8F64<1>, usize, Vec<(Complex64, usize)>>) | |
Bits128 | (CircuitExecutor<Byte8F64<2>, u128, Vec<(Complex64, u128)>>) | |
Bits256 | (CircuitExecutor<Byte8F64<4>, U256, Vec<(Complex64, U256)>>) | |
Bits512 | (CircuitExecutor<Byte8F64<8>, U512, Vec<(Complex64, U512)>>) | |
Bits1024 | (CircuitExecutor<Byte8F64<16>, U1024, Vec<(Complex64, U1024)>>) | |
Bits2048 | (CircuitExecutor<Byte8F64<32>, U2048, Vec<(Complex64, U2048)>>) |
methodnew¶source
ppvm_vihaco::component::TableauCircuit::new
pub fn new(n_qubits: usize, coefficient_threshold: f64) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
n_qubits | usize | |
coefficient_threshold | f64 |
Returns
Result<Self>
methodnew_with_seed¶source
ppvm_vihaco::component::TableauCircuit::new_with_seed
Signature
pub fn new_with_seed(n_qubits: usize, coefficient_threshold: f64, seed: u64) -> Result<Self>Parameters
| Name | Type | Description |
|---|---|---|
n_qubits | usize | |
coefficient_threshold | f64 | |
seed | u64 |
Returns
Result<Self>
Same as TableauCircuit::new, but seed the RNG deterministically so a shot is reproducible.
sourcemethodstate_string¶source
ppvm_vihaco::component::TableauCircuit::state_string
propertyMAX_QUBITS¶
ppvm_vihaco::component::MAX_QUBITS
pub const MAX_QUBITS: usizeLargest qubit count any backend can simulate. The widest size bucket is backed by 2048-bit integers (`U2048` / `[u8; 256]`), so every constructor rejects `n_qubits > MAX_QUBITS` rather than panicking.