Dynamic size vector of complex numbers. More...
Public Member Functions | |
Vector () | |
Constructs the two-dimensional vector (1 0)T | |
Vector (const int dim) | |
Constructs the null vector of dimension dim . | |
Vector (const field &c0, const field &c1) | |
Constructs the two-dimensional vector (c0 c1 )T | |
Vector & | operator= (const VectorXc &v) |
bool | isNormalized () const |
Checks if this vector is an unit vector. | |
Vector & | randomize () |
Sets all coefficients of this vector to random values. | |
Vector | tensorDot (const Vector &v) const |
Computes the tensor product of this vector with v . | |
Vector & | tensorDotSet (const Vector &v) |
Sets the tensor product of this vector and v as this vector. |
Dynamic size vector of complex numbers.
The Vector class is the base for all vectors and qubits used in QuCoSi. It is of dynamic size and uses complex numbers. Besides the standard methods that are inherited from the Eigen base class it offers some convenient methods like isNormalized() and randomize(). The most important feature of this class is the tensor product tensorDot() and tensorDotSet().
Definition at line 38 of file Vector.
QuCoSi::Vector::Vector | ( | ) | [inline] |
QuCoSi::Vector::Vector | ( | const int | dim | ) | [inline] |
Reimplemented in QuCoSi::Qubit.
bool QuCoSi::Vector::isNormalized | ( | ) | const [inline] |
Vector& QuCoSi::Vector::randomize | ( | ) | [inline] |
Computes the tensor product of this vector with v
.
The tensor product of the vectors and is defined as:
v | the right hand side operand of the tensor product |
v
Definition at line 112 of file Vector.
Sets the tensor product of this vector and v
as this vector.
This method computes the tensor product of this vector and Vector v
and sets the result as this vector. For two vectors x
and y
x.tensorDotSet(y)
is practically identical to
x = x.tensorDot(y)
v | the right hand side operand of the tensor product |
*this
Definition at line 134 of file Vector.