StateVector#

Quantarhei package (http://www.github.com/quantarhei)

statevector module

class quantarhei.qm.hilbertspace.statevector.StateVector(dim: int | None = None, data: Any = None)[source]#

Bases: BasisManaged

Represents a quantum mechanical state vector

Examples

>>> psi = StateVector(2)
>>> print(psi.dim)
2
>>> vec = numpy.zeros((1,3), dtype=float)
>>> psi = StateVector(data=vec)
Traceback (most recent call last):
...
quantarhei.exceptions.QuantarheiError: Data has to be a vector
property data: Any#
dot(vec: StateVector) Any[source]#

Scalar product of two StateVectors

norm() Any[source]#

Returns the norm of the StateVector

transform(SS: ndarray, inv: ndarray | None = None) 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

get_DensityMatrix() Any[source]#

Constructs DensityMatrix from the present StateVector