pub struct SparseBackend { /* private fields */ }Expand description
Sparse state-vector backend, O(k) where k is the number of non-zero amplitudes.
Implementations§
Trait Implementations§
Source§impl Backend for SparseBackend
impl Backend for SparseBackend
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Human-readable backend name (for error messages, logging, and benchmarks).
Source§fn init(&mut self, num_qubits: usize, num_classical_bits: usize) -> Result<()>
fn init(&mut self, num_qubits: usize, num_classical_bits: usize) -> Result<()>
Initialize (or reset) state for a circuit with the given dimensions. Read more
Source§fn apply(&mut self, instruction: &Instruction) -> Result<()>
fn apply(&mut self, instruction: &Instruction) -> Result<()>
Apply a single instruction to the current state. Read more
Source§fn reset(&mut self, qubit: usize) -> Result<()>
fn reset(&mut self, qubit: usize) -> Result<()>
Reset a qubit to |0⟩, discarding any prior amplitude on that qubit. Read more
Source§fn reduced_density_matrix_1q(&self, qubit: usize) -> Result<[[Complex64; 2]; 2]>
fn reduced_density_matrix_1q(&self, qubit: usize) -> Result<[[Complex64; 2]; 2]>
Compute the one-qubit reduced density matrix without collapsing the state. Read more
Source§fn classical_results(&self) -> &[bool]
fn classical_results(&self) -> &[bool]
Read classical measurement results. Read more
Source§fn probabilities(&self) -> Result<Vec<f64>>
fn probabilities(&self) -> Result<Vec<f64>>
Compute the probability of each computational basis state. Read more
Source§fn num_qubits(&self) -> usize
fn num_qubits(&self) -> usize
Number of qubits the backend is currently configured for.
Source§fn export_statevector(&self) -> Result<Vec<Complex64>>
fn export_statevector(&self) -> Result<Vec<Complex64>>
Export the current quantum state as a dense statevector. Read more
Source§fn apply_instructions(&mut self, instructions: &[Instruction]) -> Result<()>
fn apply_instructions(&mut self, instructions: &[Instruction]) -> Result<()>
Apply a batch of instructions to the current state. Read more
Source§fn supports_fused_gates(&self) -> bool
fn supports_fused_gates(&self) -> bool
Whether this backend can handle
Gate::Fused variants. Read moreSource§fn supports_qft_block(&self) -> bool
fn supports_qft_block(&self) -> bool
Whether this backend has a native kernel for
Gate::QftBlock. Read moreAuto Trait Implementations§
impl Freeze for SparseBackend
impl RefUnwindSafe for SparseBackend
impl Send for SparseBackend
impl Sync for SparseBackend
impl Unpin for SparseBackend
impl UnsafeUnpin for SparseBackend
impl UnwindSafe for SparseBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more