pub struct LcuOperator { /* private fields */ }Expand description
The LCU operator A = Σ_l c_l P_l and its dense f32 matrix.
Implementations§
Source§impl LcuOperator
impl LcuOperator
Sourcepub fn new(terms: &[PauliTerm], n_qubits: usize) -> QuantumResult<Self>
pub fn new(terms: &[PauliTerm], n_qubits: usize) -> QuantumResult<Self>
Build the dense matrix of A = Σ_l c_l P_l from a list of Pauli-string
terms over n_qubits qubits.
§Errors
QuantumError::EmptyInputiftermsis empty.QuantumError::InvalidQubitCountifn_qubits == 0orn_qubits > 8(the dense matrix would be impractical beyond that).QuantumError::DimensionMismatchif any term’s Pauli-string length is notn_qubits.
Trait Implementations§
Source§impl Clone for LcuOperator
impl Clone for LcuOperator
Auto Trait Implementations§
impl Freeze for LcuOperator
impl RefUnwindSafe for LcuOperator
impl Send for LcuOperator
impl Sync for LcuOperator
impl Unpin for LcuOperator
impl UnsafeUnpin for LcuOperator
impl UnwindSafe for LcuOperator
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