public final class KetVector extends MathVector
CLASS_SPECIFIC, N, storageFormat
Constructor and Description |
---|
KetVector(ComplexVector rep)
Constructs a ket vector given a vector representation.
|
Modifier and Type | Method and Description |
---|---|
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.
|
ComplexVector |
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.
|
dimension, getInvalidComponentMsg
public KetVector(ComplexVector rep)
rep
- a vector representationpublic boolean equals(java.lang.Object a)
equals
in class java.lang.Object
a
- a ket vectorpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public BraVector toBraVector()
public ComplexVector getRepresentation()
public double norm()
norm
in class MathVector
public AbelianGroup.Member negate()
public AbelianGroup.Member add(AbelianGroup.Member v)
v
- a group memberpublic KetVector add(KetVector v)
v
- a ket vectorVectorDimensionException
- If the vectors are different sizes.public AbelianGroup.Member subtract(AbelianGroup.Member v)
v
- a group memberpublic KetVector subtract(KetVector v)
v
- a ket vectorVectorDimensionException
- If the vectors are different sizes.public Module.Member scalarMultiply(Ring.Member x)
x
- a ring memberpublic Operator multiply(BraVector bra)
bra
- a bra vectorVectorDimensionException
- If the vectors have different dimensions.