Type Definition qdk_sim::State [−][src]
pub type State = QubitSized<StateData>;
Expand description
The state of a quantum system.
Implementations
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}$.
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$.
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}$.
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());
If the given state can be represented by a stabilizer tableau, returns that tableau.