qgame::QuSubReg Class Reference
[Basic Types]

References one or more qubits of a Qureg. More...

#include <qgtypes.h>

List of all members.

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.

Complexoperator[] (const unsigned int) throw (Error)
 Returns a reference to the addressed qubit.


Detailed Description

References one or more qubits of a Qureg.

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.


The documentation for this class was generated from the following files:
Generated on Sat Apr 3 18:42:39 2004 for QGame++ by doxygen 1.3.5