JSci.physics.quantum
Class BraVector

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

public final class BraVector
extends MathVector

The BraVector class provides an object for encapsulating Dirac bra vectors.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class JSci.maths.vectors.MathVector
N
 
Constructor Summary
BraVector(AbstractComplexVector rep)
          Constructs a bra vector given a vector representation.
 
Method Summary
 AbelianGroup.Member add(AbelianGroup.Member v)
          Returns the addition of this vector and another.
 BraVector add(BraVector v)
          Returns the addition of this vector and another.
 boolean equals(java.lang.Object a)
          Compares two bra vectors for equality.
 AbstractComplexVector getRepresentation()
          Returns the representation.
 java.lang.Object getSet()
           
 int hashCode()
          Returns a hashcode for this bra vector.
 Complex multiply(KetVector ket)
          Returns the multiplication of this bra vector and a ket vector.
 BraVector multiply(Operator op)
          Returns the multiplication of this bra vector and an operator.
 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 bra vector by a scalar.
 AbelianGroup.Member subtract(AbelianGroup.Member v)
          Returns the subtraction of this vector by another.
 BraVector subtract(BraVector v)
          Returns the subtraction of this vector by another.
 KetVector toKetVector()
          Map this bra vector to a ket vector.
 java.lang.String toString()
          Returns a comma delimited string representing the value of this bra 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

BraVector

public BraVector(AbstractComplexVector rep)
Constructs a bra vector given a vector representation.

Parameters:
rep - a vector representation
Method Detail

equals

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

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

toString

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

Overrides:
toString in class java.lang.Object

hashCode

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

Overrides:
hashCode in class java.lang.Object

toKetVector

public KetVector toKetVector()
Map this bra vector to a ket 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 BraVector add(BraVector v)
Returns the addition of this vector and another.

Parameters:
v - a bra 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 BraVector subtract(BraVector v)
Returns the subtraction of this vector by another.

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

scalarMultiply

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

Parameters:
x - a ring member

multiply

public Complex multiply(KetVector ket)
Returns the multiplication of this bra vector and a ket vector.

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

multiply

public BraVector multiply(Operator op)
Returns the multiplication of this bra vector and an operator.

Parameters:
op - an operator
Throws:
DimensionException - If the operator and vector have different dimensions.