jsci.physics.quantum
Class KetVector
- java.lang.Object
-
- jsci.maths.vectors.MathVector
-
- 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
-
-
Constructor Summary
Constructors Constructor and Description KetVector(AbstractComplexVector rep)Constructs a ket vector given a vector representation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AbelianGroup.Memberadd(AbelianGroup.Member v)Returns the addition of this vector and another.KetVectoradd(KetVector v)Returns the addition of this vector and another.booleanequals(java.lang.Object a)Compares two ket vectors for equality.AbstractComplexVectorgetRepresentation()Returns the representation.java.lang.ObjectgetSet()inthashCode()Returns a hashcode for this ket vector.Operatormultiply(BraVector bra)Returns the multiplication of this ket vector and a bra vector.AbelianGroup.Membernegate()Returns the negative of this vector.doublenorm()Returns the norm.Module.MemberscalarMultiply(Ring.Member x)Returns the multiplication of this ket vector by a scalar.AbelianGroup.Membersubtract(AbelianGroup.Member v)Returns the subtraction of this vector by another.KetVectorsubtract(KetVector v)Returns the subtraction of this vector by another.BraVectortoBraVector()Map this ket vector to a bra vector.java.lang.StringtoString()Returns a comma delimited string representing the value of this ket vector.-
Methods inherited from class jsci.maths.vectors.MathVector
dimension
-
-
-
-
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:
equalsin classjava.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:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hashcode for this ket vector.- Overrides:
hashCodein classjava.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:
normin classMathVector
-
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG