JSci.physics.quantum
Class KetVector

java.lang.Object
  extended by JSci.maths.vectors.MathVector
      extended by JSci.physics.quantum.KetVector
All Implemented Interfaces:
java.io.Serializable, Module.Member, AbelianGroup.Member, Member

public final class KetVector
extends MathVector

The KetVector class provides an object for encapsulating Dirac ket vectors.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class JSci.maths.vectors.MathVector
N
 
Constructor Summary
KetVector(AbstractComplexVector rep)
          Constructs a ket vector given a vector representation.
 
Method Summary
 AbelianGroup.Member add(AbelianGroup.Member v)
          Returns the addition of this vector and another.
 KetVector add(KetVector v)
          Returns the addition of this vector and another.
 boolean equals(java.lang.Object a)
          Compares two ket vectors for equality.
 AbstractComplexVector getRepresentation()
          Returns the representation.
 java.lang.Object getSet()
           
 int hashCode()
          Returns a hashcode for this ket vector.
 Operator multiply(BraVector bra)
          Returns the multiplication of this ket vector and a bra vector.
 AbelianGroup.Member negate()
          Returns the negative of this vector.
 double norm()
          Returns the norm.
 Module.Member scalarMultiply(Ring.Member x)
          Returns the multiplication of this ket vector by a scalar.
 AbelianGroup.Member subtract(AbelianGroup.Member v)
          Returns the subtraction of this vector by another.
 KetVector subtract(KetVector v)
          Returns the subtraction of this vector by another.
 BraVector toBraVector()
          Map this ket vector to a bra vector.
 java.lang.String toString()
          Returns a comma delimited string representing the value of this ket vector.
 
Methods inherited from class JSci.maths.vectors.MathVector
dimension, getInvalidComponentMsg
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KetVector

public KetVector(AbstractComplexVector rep)
Constructs a ket vector given a vector representation.

Parameters:
rep - a vector representation
Method Detail

equals

public boolean equals(java.lang.Object a)
Compares two ket vectors for equality.

Overrides:
equals in class java.lang.Object
Parameters:
a - a ket vector

toString

public java.lang.String toString()
Returns a comma delimited string representing the value of this ket vector.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Returns a hashcode for this ket vector.

Overrides:
hashCode in class java.lang.Object

toBraVector

public BraVector toBraVector()
Map this ket vector to a bra vector.


getRepresentation

public AbstractComplexVector getRepresentation()
Returns the representation.


norm

public double norm()
Returns the norm.

Specified by:
norm in class MathVector

getSet

public java.lang.Object getSet()

negate

public AbelianGroup.Member negate()
Returns the negative of this vector.


add

public AbelianGroup.Member add(AbelianGroup.Member v)
Returns the addition of this vector and another.

Parameters:
v - a group member

add

public KetVector add(KetVector v)
Returns the addition of this vector and another.

Parameters:
v - a ket vector
Throws:
VectorDimensionException - If the vectors are different sizes.

subtract

public AbelianGroup.Member subtract(AbelianGroup.Member v)
Returns the subtraction of this vector by another.

Parameters:
v - a group member

subtract

public KetVector subtract(KetVector v)
Returns the subtraction of this vector by another.

Parameters:
v - a ket vector
Throws:
VectorDimensionException - If the vectors are different sizes.

scalarMultiply

public Module.Member scalarMultiply(Ring.Member x)
Returns the multiplication of this ket vector by a scalar.

Parameters:
x - a ring member

multiply

public Operator multiply(BraVector bra)
Returns the multiplication of this ket vector and a bra vector.

Parameters:
bra - a bra vector
Throws:
VectorDimensionException - If the vectors have different dimensions.