public class Operator extends java.lang.Object implements Member
Modifier and Type | Field and Description |
---|---|
protected ComplexSquareMatrix |
representation |
Constructor and Description |
---|
Operator(ComplexSquareMatrix rep)
Constructs an operator given a matrix representation.
|
Modifier and Type | Method and Description |
---|---|
Operator |
add(Operator op)
Returns the addition of this operator and another.
|
int |
dimension()
Returns the dimension.
|
boolean |
equals(java.lang.Object a)
Compares two operators for equality.
|
ComplexSquareMatrix |
getRepresentation()
Returns the representation.
|
int |
hashCode()
Returns a hashcode for this operator.
|
boolean |
isSelfAdjoint()
Returns true if this operator is self-adjoint.
|
boolean |
isUnitary()
Returns true if this operator is unitary.
|
KetVector |
multiply(KetVector ket)
Returns the multiplication of this operator and a ket vector.
|
Operator |
multiply(Operator op)
Returns the multiplication of this operator and another.
|
double |
norm()
Returns the operator norm.
|
Operator |
subtract(Operator op)
Returns the subtraction of this operator and another.
|
java.lang.String |
toString()
Returns a string representing this operator.
|
Complex |
trace()
Returns the trace.
|
protected ComplexSquareMatrix representation
public Operator(ComplexSquareMatrix rep)
rep
- a matrix representationpublic boolean equals(java.lang.Object a)
equals
in class java.lang.Object
a
- an operatorpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public ComplexSquareMatrix getRepresentation()
public boolean isSelfAdjoint()
public boolean isUnitary()
public Complex trace()
public double norm()
public int dimension()
public Operator add(Operator op)
op
- an operatorMatrixDimensionException
- If the operators have different dimensions.public Operator subtract(Operator op)
op
- an operatorMatrixDimensionException
- If the operators have different dimensions.public Operator multiply(Operator op)
op
- an operatorMatrixDimensionException
- If the operators have different dimensions.public KetVector multiply(KetVector ket)
ket
- a ket vectorDimensionException
- If the operator and vector have different dimensions.