StateVector¶
Quantarhei package (http://www.github.com/quantarhei)
statevector module
-
class
quantarhei.qm.hilbertspace.statevector.
StateVector
(dim=None, data=None)[source]¶ Represents a quantum mechanical state vector
Examples
>>> psi = StateVector(2) >>> print(psi.dim) 2
>>> vec = numpy.zeros((1,3), dtype=REAL) >>> psi = StateVector(data=vec) Traceback (most recent call last): ... Exception: Data has to be a vector
Attributes: - data
Methods
dot
(vec)Scalar product of two StateVectors get_DensityMatrix
()Constructs DensityMatrix from the present StateVector norm
()Returns the norm of the StateVector transform
(SS[, inv])Transformation of the operator by a given matrix get_current_basis protect_basis set_current_basis unprotect_basis -
transform
(SS, inv=None)[source]¶ Transformation of the operator by a given matrix
This function transforms the Operator into a different basis, using a given transformation matrix.
Parameters: - SS (matrix, numpy.ndarray) – transformation matrix
- inv (matrix, numpy.ndarray) – inverse of the transformation matrix