Skip to content

ppvm_vihaco::component

component

ppvm_vihaco::component

classCircuitExecutorsource

ppvm_vihaco::component::CircuitExecutor

Bases: GeneratedComponent, Reset

Rust struct.

Signature
pub struct CircuitExecutor<T: Config, I: TableauIndex, C: SparseVector<Complex64, I>>

Fields

NameTypeDescription
tabGeneralizedTableau&lt;T, I, C&gt;
source

classLossyPauliSumExecutorsource

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`).

pub struct LossyPauliSumExecutor<T: Config>

Fields

NameTypeDescription
statePauliSum&lt;T&gt;
source

classPauliSumExecutorsource

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.

pub struct PauliSumExecutor<T: Config>

Fields

NameTypeDescription
statePauliSum&lt;T&gt;
source

classCircuitsource

ppvm_vihaco::component::Circuit

Bases: HasInstructionSet, GeneratedComponent, Observe&lt;CircuitEffect&gt;, 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 Circuit

Variants

NameTypeDescription
Tableau(TableauCircuit)
PauliSum(PauliSumCircuit)
LossyPauliSum(LossyPauliSumCircuit)
source

methodlossy_paulisumsource

ppvm_vihaco::component::Circuit::lossy_paulisum

Signature
pub fn lossy_paulisum(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>

Parameters

NameTypeDescription
info&amp;PPVMDeviceInfo
terms&amp;[(String, f64)]

Returns

Result<Self>

Build a LossyPauliSum-backed circuit. Same contract as Circuit::paulisum.

source

methodpaulisumsource

ppvm_vihaco::component::Circuit::paulisum

Signature
pub fn paulisum(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>

Parameters

NameTypeDescription
info&amp;PPVMDeviceInfo
terms&amp;[(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`).

source

methodstate_stringsource

ppvm_vihaco::component::Circuit::state_string

pub fn state_string(&self) -> String

Returns

String

Render the current state. Used by the REPL’s `show` command.

source

methodtableausource

ppvm_vihaco::component::Circuit::tableau

pub fn tableau(info: &PPVMDeviceInfo) -> Result<Self>

Parameters

NameTypeDescription
info&amp;PPVMDeviceInfo

Returns

Result<Self>

Build a Tableau-backed circuit. Tableau init only needs `n_qubits` and `coefficient_threshold` from `info`; no observable required.

source

methodtableau_with_seedsource

ppvm_vihaco::component::Circuit::tableau_with_seed

Signature
pub fn tableau_with_seed(info: &PPVMDeviceInfo, seed: u64) -> Result<Self>

Parameters

NameTypeDescription
info&amp;PPVMDeviceInfo
seedu64

Returns

Result<Self>

Same as Circuit::tableau, but seed the tableau RNG deterministically so a shot is reproducible.

source

classLossyPauliSumCircuitsource

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 LossyPauliSumCircuit

Variants

NameTypeDescription
Bits64(LossyPauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;, LossyPauliWord&lt;[u8; N]&gt;&gt;&gt;)
Bits128(LossyPauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;, LossyPauliWord&lt;[u8; N]&gt;&gt;&gt;)
Bits256(LossyPauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;, LossyPauliWord&lt;[u8; N]&gt;&gt;&gt;)
Bits512(LossyPauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;, LossyPauliWord&lt;[u8; N]&gt;&gt;&gt;)
Bits1024(LossyPauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;, LossyPauliWord&lt;[u8; N]&gt;&gt;&gt;)
Bits2048(LossyPauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;, LossyPauliWord&lt;[u8; N]&gt;&gt;&gt;)
source

methodnewsource

ppvm_vihaco::component::LossyPauliSumCircuit::new

Signature
pub fn new(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>

Parameters

NameTypeDescription
info&amp;PPVMDeviceInfo
terms&amp;[(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.

source

methodstate_stringsource

ppvm_vihaco::component::LossyPauliSumCircuit::state_string

pub fn state_string(&self) -> String

Returns

String

source

classPauliSumCircuitsource

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 PauliSumCircuit

Variants

NameTypeDescription
Bits64(PauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;&gt;&gt;)
Bits128(PauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;&gt;&gt;)
Bits256(PauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;&gt;&gt;)
Bits512(PauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;&gt;&gt;)
Bits1024(PauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;&gt;&gt;)
Bits2048(PauliSumExecutor&lt;ByteFxHashF64&lt;N, CombinedStrategy&lt;CoefficientThreshold, MaxPauliWeight&gt;&gt;&gt;)
source

methodnewsource

ppvm_vihaco::component::PauliSumCircuit::new

Signature
pub fn new(info: &PPVMDeviceInfo, terms: &[(String, f64)]) -> Result<Self>

Parameters

NameTypeDescription
info&amp;PPVMDeviceInfo
terms&amp;[(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.

source

methodstate_stringsource

ppvm_vihaco::component::PauliSumCircuit::state_string

pub fn state_string(&self) -> String

Returns

String

source

classTableauCircuitsource

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 TableauCircuit

Variants

NameTypeDescription
Bits64(CircuitExecutor&lt;Byte8F64&lt;1&gt;, usize, Vec&lt;(Complex64, usize)&gt;&gt;)
Bits128(CircuitExecutor&lt;Byte8F64&lt;2&gt;, u128, Vec&lt;(Complex64, u128)&gt;&gt;)
Bits256(CircuitExecutor&lt;Byte8F64&lt;4&gt;, U256, Vec&lt;(Complex64, U256)&gt;&gt;)
Bits512(CircuitExecutor&lt;Byte8F64&lt;8&gt;, U512, Vec&lt;(Complex64, U512)&gt;&gt;)
Bits1024(CircuitExecutor&lt;Byte8F64&lt;16&gt;, U1024, Vec&lt;(Complex64, U1024)&gt;&gt;)
Bits2048(CircuitExecutor&lt;Byte8F64&lt;32&gt;, U2048, Vec&lt;(Complex64, U2048)&gt;&gt;)
source

methodnewsource

ppvm_vihaco::component::TableauCircuit::new

pub fn new(n_qubits: usize, coefficient_threshold: f64) -> Result<Self>

Parameters

NameTypeDescription
n_qubitsusize
coefficient_thresholdf64

Returns

Result<Self>

source

methodnew_with_seedsource

ppvm_vihaco::component::TableauCircuit::new_with_seed

Signature
pub fn new_with_seed(n_qubits: usize, coefficient_threshold: f64, seed: u64) -> Result<Self>

Parameters

NameTypeDescription
n_qubitsusize
coefficient_thresholdf64
seedu64

Returns

Result<Self>

Same as TableauCircuit::new, but seed the RNG deterministically so a shot is reproducible.

source

methodstate_stringsource

ppvm_vihaco::component::TableauCircuit::state_string

pub fn state_string(&self) -> String

Returns

String

source

propertyMAX_QUBITS

ppvm_vihaco::component::MAX_QUBITS

pub const MAX_QUBITS: usize

Largest 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.