JSci.physics.quantum
Class Operator

java.lang.Object
  extended by 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

Field Summary
protected  AbstractComplexSquareMatrix representation
           
 
Constructor Summary
Operator(AbstractComplexSquareMatrix rep)
          Constructs an operator given a matrix representation.
 
Method Summary
 Operator add(Operator op)
          Returns the addition of this operator and another.
 int dimension()
          Returns the dimension.
 boolean equals(java.lang.Object a)
          Compares two operators for equality.
 AbstractComplexSquareMatrix getRepresentation()
          Returns the representation.
 java.lang.Object getSet()
           
 int hashCode()
          Returns a hashcode for this operator.
 boolean isSelfAdjoint()
          Returns true if this operator is self-adjoint.
 boolean isUnitary()
          Returns true if this operator is unitary.
 KetVector multiply(KetVector ket)
          Returns the multiplication of this operator and a ket vector.
 Operator multiply(Operator op)
          Returns the multiplication of this operator and another.
 double norm()
          Returns the operator norm.
 Operator subtract(Operator op)
          Returns the subtraction of this operator and another.
 java.lang.String toString()
          Returns a string representing this operator.
 Complex trace()
          Returns the trace.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

representation

protected AbstractComplexSquareMatrix representation
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:
equals in class java.lang.Object
Parameters:
a - an operator

toString

public java.lang.String toString()
Returns a string representing this operator.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Returns a hashcode for this operator.

Overrides:
hashCode in class java.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.


getSet

public java.lang.Object getSet()
Specified by:
getSet in interface Member

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.