JSci.physics.quantum
Class KetVector

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

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.
 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.

Parameters:
a - a ket vector

toString

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


hashCode

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


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

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.