pub struct QubitSized<T> { /* private fields */ }
Expand description
Represents that a given type has a size that can be measured in terms
of a number of qubits (e.g.: State
).
Implementations§
Source§impl QubitSized<ProcessData>
impl QubitSized<ProcessData>
Source§impl QubitSized<ProcessData>
impl QubitSized<ProcessData>
Sourcepub fn new_pauli_channel<T: IntoPauliMixture>(data: T) -> Self
pub fn new_pauli_channel<T: IntoPauliMixture>(data: T) -> Self
Returns a new Pauli channel, given a mixture of Pauli operators.
Sourcepub fn as_json(&self) -> String
pub fn as_json(&self) -> String
Returns a serialization of this quantum process as a JSON object.
Sourcepub fn extend_one_to_n(&self, idx_qubit: usize, n_qubits: usize) -> Process
pub fn extend_one_to_n(&self, idx_qubit: usize, n_qubits: usize) -> Process
Returns a copy of this process that applies to registers of a given size.
Source§impl QubitSized<StateData>
impl QubitSized<StateData>
Sourcepub fn new_mixed(n_qubits: usize) -> State
pub fn new_mixed(n_qubits: usize) -> State
Returns a new mixed state on a given number of qubits. By convention, new mixed states start off in the “all-zeros” state, $\rho = \ket{00\cdots 0}\bra{00\cdots 0}$.
Sourcepub fn new_stabilizer(n_qubits: usize) -> State
pub fn new_stabilizer(n_qubits: usize) -> State
Returns a new stabilizer state on a given number of qubits. By convention, new stabilizer states start off in the “all-zeros” state, $\left\langle Z_0, Z_1, \dots, Z_{n - 1} \right\rangle$.
Sourcepub fn new_pure(n_qubits: usize) -> State
pub fn new_pure(n_qubits: usize) -> State
Returns a new pure state on a given number of qubits. By convention, new pure states start off in the “all-zeros” state, $\ket{\psi} = \ket{00\cdots 0}$.
Sourcepub fn as_json(&self) -> String
pub fn as_json(&self) -> String
Returns a serialization of this quantum state as a JSON object.
Sourcepub fn extend(&self, n_qubits: usize) -> State
pub fn extend(&self, n_qubits: usize) -> State
Extends this state to be a state on n_qubits
additional qubits.
New qubits are added “to the right,” e.g.: $\left|\psi\right\rangle$
is extended to $\left|\psi 0\right\rangle$.
§Example
let rho = State::new_mixed(2);
assert_eq!(5, rho.extend(3).get_n_qubits());
Sourcepub fn get_tableau(&self) -> Option<&Tableau>
pub fn get_tableau(&self) -> Option<&Tableau>
If the given state can be represented by a stabilizer tableau, returns that tableau.
Source§impl<T> QubitSized<T>
impl<T> QubitSized<T>
Sourcepub fn get_n_qubits(&self) -> usize
pub fn get_n_qubits(&self) -> usize
Returns the number of qubits that this value relates to.
Trait Implementations§
Source§impl Add<&QubitSized<ProcessData>> for &Process
impl Add<&QubitSized<ProcessData>> for &Process
Source§impl Add<&QubitSized<ProcessData>> for Process
impl Add<&QubitSized<ProcessData>> for Process
Source§impl Add<QubitSized<ProcessData>> for &Process
impl Add<QubitSized<ProcessData>> for &Process
Source§impl<T: Clone> Clone for QubitSized<T>
impl<T: Clone> Clone for QubitSized<T>
Source§fn clone(&self) -> QubitSized<T>
fn clone(&self) -> QubitSized<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug> Debug for QubitSized<T>
impl<T: Debug> Debug for QubitSized<T>
Source§impl<'de, T> Deserialize<'de> for QubitSized<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for QubitSized<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Mul<&QubitSized<ProcessData>> for &Process
impl Mul<&QubitSized<ProcessData>> for &Process
Source§impl Mul<&QubitSized<ProcessData>> for C64
impl Mul<&QubitSized<ProcessData>> for C64
Source§impl Mul<&QubitSized<ProcessData>> for Process
impl Mul<&QubitSized<ProcessData>> for Process
Source§impl Mul<&QubitSized<ProcessData>> for f64
impl Mul<&QubitSized<ProcessData>> for f64
Source§impl Mul<QubitSized<ProcessData>> for &Process
impl Mul<QubitSized<ProcessData>> for &Process
Source§impl Mul<QubitSized<ProcessData>> for C64
impl Mul<QubitSized<ProcessData>> for C64
Source§impl Mul<QubitSized<ProcessData>> for f64
impl Mul<QubitSized<ProcessData>> for f64
Auto Trait Implementations§
impl<T> Freeze for QubitSized<T>where
T: Freeze,
impl<T> RefUnwindSafe for QubitSized<T>where
T: RefUnwindSafe,
impl<T> Send for QubitSized<T>where
T: Send,
impl<T> Sync for QubitSized<T>where
T: Sync,
impl<T> Unpin for QubitSized<T>where
T: Unpin,
impl<T> UnwindSafe for QubitSized<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more