jsci.physics.quantum
Class Operator
- java.lang.Object
-
- jsci.physics.quantum.Operator
-
- All Implemented Interfaces:
- java.io.Serializable, Member
- Direct Known Subclasses:
- DensityMatrix, Projector, SpinOperator
public class Operator extends java.lang.Object implements Member
The Operator class provides an object for encapsulating quantum mechanical operators.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Operator(AbstractComplexSquareMatrix rep)Constructs an operator given a matrix representation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Operatoradd(Operator op)Returns the addition of this operator and another.intdimension()Returns the dimension.booleanequals(java.lang.Object a)Compares two operators for equality.AbstractComplexSquareMatrixgetRepresentation()Returns the representation.java.lang.ObjectgetSet()inthashCode()Returns a hashcode for this operator.booleanisSelfAdjoint()Returns true if this operator is self-adjoint.booleanisUnitary()Returns true if this operator is unitary.KetVectormultiply(KetVector ket)Returns the multiplication of this operator and a ket vector.Operatormultiply(Operator op)Returns the multiplication of this operator and another.doublenorm()Returns the operator norm.Operatorsubtract(Operator op)Returns the subtraction of this operator and another.java.lang.StringtoString()Returns a string representing this operator.Complextrace()Returns the trace.
-
-
-
Constructor Detail
-
Operator
public Operator(AbstractComplexSquareMatrix rep)
Constructs an operator given a matrix representation.- Parameters:
rep- a matrix representation
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object a)
Compares two operators for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
a- an operator
-
toString
public java.lang.String toString()
Returns a string representing this operator.- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hashcode for this operator.- Overrides:
hashCodein classjava.lang.Object
-
getRepresentation
public AbstractComplexSquareMatrix getRepresentation()
Returns the representation.
-
isSelfAdjoint
public boolean isSelfAdjoint()
Returns true if this operator is self-adjoint.
-
isUnitary
public boolean isUnitary()
Returns true if this operator is unitary.
-
trace
public Complex trace()
Returns the trace.
-
norm
public double norm()
Returns the operator norm.
-
dimension
public int dimension()
Returns the dimension.
-
add
public Operator add(Operator op)
Returns the addition of this operator and another.- Parameters:
op- an operator- Throws:
MatrixDimensionException- If the operators have different dimensions.
-
subtract
public Operator subtract(Operator op)
Returns the subtraction of this operator and another.- Parameters:
op- an operator- Throws:
MatrixDimensionException- If the operators have different dimensions.
-
multiply
public Operator multiply(Operator op)
Returns the multiplication of this operator and another.- Parameters:
op- an operator- Throws:
MatrixDimensionException- If the operators have different dimensions.
-
multiply
public KetVector multiply(KetVector ket)
Returns the multiplication of this operator and a ket vector.- Parameters:
ket- a ket vector- Throws:
DimensionException- If the operator and vector have different dimensions.
-
-
DMelt 3.0 © DataMelt by jWork.ORG