pub struct StatevectorBackend { /* private fields */ }Expand description
Full state-vector backend.
Implementations§
Source§impl StatevectorBackend
impl StatevectorBackend
Sourcepub fn state_vector(&self) -> &[Complex64] ⓘ
pub fn state_vector(&self) -> &[Complex64] ⓘ
Read-only access to the raw amplitude vector.
After measurements, amplitudes may be un-normalized due to deferred
normalization. Call export_statevector
for a properly normalized copy.
Trait Implementations§
Source§impl Backend for StatevectorBackend
impl Backend for StatevectorBackend
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Human-readable backend name (for error messages, logging, and benchmarks).
Source§fn supports_qft_block(&self) -> bool
fn supports_qft_block(&self) -> bool
Whether this backend has a native kernel for
Gate::QftBlock. Read moreSource§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 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 qubit_probability(&self, qubit: usize) -> Result<f64>
fn qubit_probability(&self, qubit: usize) -> Result<f64>
Compute P(qubit = |1⟩) without collapsing the state. 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 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 apply_1q_matrix(
&mut self,
qubit: usize,
matrix: &[[Complex64; 2]; 2],
) -> Result<()>
fn apply_1q_matrix( &mut self, qubit: usize, matrix: &[[Complex64; 2]; 2], ) -> Result<()>
Apply a 2×2 matrix to a single qubit without allocating. 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 moreAuto Trait Implementations§
impl Freeze for StatevectorBackend
impl RefUnwindSafe for StatevectorBackend
impl Send for StatevectorBackend
impl Sync for StatevectorBackend
impl Unpin for StatevectorBackend
impl UnsafeUnpin for StatevectorBackend
impl UnwindSafe for StatevectorBackend
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