org.jscience.physics.quantum
Class KetVector

java.lang.Object
  extended by org.jscience.mathematics.algebraic.AbstractHypermatrix
      extended by org.jscience.mathematics.algebraic.AbstractMatrix
          extended by org.jscience.mathematics.algebraic.AbstractVector
              extended by org.jscience.physics.quantum.KetVector
All Implemented Interfaces:
java.io.Serializable, Algebra.Member, Ring.Member, AbelianGroup.Member, Hypermatrix, Matrix, Module.Member, VectorSpace.Member, Vector, Member

public final class KetVector
extends AbstractVector

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

See Also:
Serialized Form

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.
 Vector getColumn(int j)
          DOCUMENT ME!
 Complex getElement(int i)
          Returns the element.
 AbstractComplexVector getRepresentation()
          Returns the representation.
 Vector getRow(int i)
          DOCUMENT ME!
 int hashCode()
          Returns a hashcode for this ket vector.
 Operator multiply(BraVector bra)
          Returns the multiplication of this ket vector and a bra vector.
 Ring.Member multiply(Ring.Member r)
          DOCUMENT ME!
 AbelianGroup.Member negate()
          Returns the negative of this vector.
 double norm()
          Returns the norm.
 VectorSpace.Member scalarDivide(Field.Member f)
          DOCUMENT ME!
 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.
 Matrix transpose()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.mathematics.algebraic.AbstractVector
getDimension, getElement, getInvalidElementMsg, toArray, toArray
 
Methods inherited from class org.jscience.mathematics.algebraic.AbstractMatrix
getElement, getInvalidElementMsg, numColumns, numRows, print, print, print, print, toArray
 
Methods inherited from class org.jscience.mathematics.algebraic.AbstractHypermatrix
getDimensions, numDimensions, numElements, numElements, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jscience.mathematics.algebraic.Matrix
numColumns, numRows, toArray
 
Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix
getDimensions, getElement, numDimensions, numElements, numElements, toArray
 

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
Returns:
DOCUMENT ME!

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
Returns:
DOCUMENT ME!

hashCode

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

Overrides:
hashCode in class java.lang.Object
Returns:
DOCUMENT ME!

toBraVector

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

Returns:
DOCUMENT ME!

getRepresentation

public AbstractComplexVector getRepresentation()
Returns the representation.

Returns:
DOCUMENT ME!

getElement

public Complex getElement(int i)
Returns the element.

Specified by:
getElement in interface Vector
Specified by:
getElement in class AbstractVector
Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

norm

public double norm()
Returns the norm.

Returns:
DOCUMENT ME!

negate

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

Returns:
DOCUMENT ME!

add

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

Parameters:
v - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

add

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

Parameters:
v - a ket vector
Returns:
DOCUMENT ME!

subtract

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

Parameters:
v - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

subtract

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

Parameters:
v - a ket vector
Returns:
DOCUMENT ME!

scalarMultiply

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

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

multiply

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

Parameters:
bra - a bra vector
Returns:
DOCUMENT ME!
Throws:
IllegalDimensionException - If the vectors have different dimensions.

getRow

public Vector getRow(int i)
DOCUMENT ME!

Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

getColumn

public Vector getColumn(int j)
DOCUMENT ME!

Parameters:
j - DOCUMENT ME!
Returns:
DOCUMENT ME!

transpose

public Matrix transpose()
DOCUMENT ME!

Returns:
DOCUMENT ME!

scalarDivide

public VectorSpace.Member scalarDivide(Field.Member f)
DOCUMENT ME!

Parameters:
f - DOCUMENT ME!
Returns:
DOCUMENT ME!

multiply

public Ring.Member multiply(Ring.Member r)
DOCUMENT ME!

Parameters:
r - DOCUMENT ME!
Returns:
DOCUMENT ME!