#include <qgtypes.h>
Public Member Functions | |
QuSubReg (int numQb) | |
The size of the QuSubReg (number of qubits, NOT amplitudes!) must be given. | |
unsigned int | numQb () const |
Returns the size of the QuSubReg (number of qubits, NOT amplitudes). | |
unsigned int | numAmps () const |
Returns the number of amplitudes. | |
Complex & | operator[] (const unsigned int) throw (Error) |
Returns a reference to the addressed qubit. |
This enables access to only a part of a Qureg, addressed by one or more qubits. The entries of a QuSubReg (accessed by []) are in binary order, addressed by the qubits in the QubitList given to Qureg::getSubRegs(qubits), with the first qubit added to the list being the least significant (rightmost, fastest varying...). Note that a QuSubReg contains references, thus manipulating an amplitude by means of QuSubReg[] will directly influence the underlying Qureg. Which is of course what one usually wants.
Definition at line 96 of file qgtypes.h.