Function initPlusState

Source
pub unsafe extern "C" fn initPlusState(qureg: Qureg)
Expand description

Initialise \p qureg into the plus state.

If \p qureg is a state-vector of \f$N\f$ qubits, it is modified to state \f[ {| + \rangle}^{\otimes N} = \frac{1}{\sqrt{2^N}} (| 0 \rangle + | 1 \rangle)^{\otimes N},. \f] If \p qureg is a density matrix of \f$N\f$ qubits, it is modified to state \f[ {| + \rangle\langle+|}^{\otimes N} = \frac{1}{{2^N}} \sum_i\sum_j |i\rangle\langle j|,. \f]

@ingroup init @param[in,out] qureg the object representing the set of qubits to be initialised @author Ania Brown (state-vector) @author Tyson Jones (density matrix, doc)