1 package JSci.maths.algebras; 2 3 import JSci.maths.*; 4 import JSci.maths.matrices.AbstractComplexMatrix; 5 import JSci.maths.matrices.AbstractComplexSquareMatrix; 6 import JSci.maths.matrices.ComplexSquareMatrix; 7 import JSci.maths.vectors.AbstractDoubleVector; 8 import JSci.maths.vectors.Double3Vector; 9 import JSci.maths.vectors.VectorDimensionException; 10 import JSci.maths.fields.ComplexField; 11 12 19 public final class su2Dim2 extends LieAlgebra { 20 private final static Complex t1[][]={ 21 {Complex.ZERO,ComplexField.HALF}, 22 {ComplexField.HALF,Complex.ZERO} 23 }; 24 private final static Complex t2[][]={ 25 {Complex.ZERO,ComplexField.HALF_I}, 26 {ComplexField.MINUS_HALF_I,Complex.ZERO} 27 }; 28 private final static Complex t3[][]={ 29 {ComplexField.HALF,Complex.ZERO}, 30 {Complex.ZERO,ComplexField.MINUS_HALF} 31 }; 32 35 private final static AbstractComplexSquareMatrix basisMatrices[]={ 36 new ComplexSquareMatrix(t1), 37 new ComplexSquareMatrix(t2), 38 new ComplexSquareMatrix(t3) 39 }; 40 41 private final static su2Dim2 _instance = new su2Dim2(); 42 45 private su2Dim2() { 46 super("su(2) [2]"); 47 } 48 51 public static final su2Dim2 getInstance() { 52 return _instance; 53 } 54 57 public AbstractComplexSquareMatrix getElement(final AbstractDoubleVector v) { 58 AbstractComplexMatrix m=basisMatrices[0].scalarMultiply(v.getComponent(0)); 59 m=m.add(basisMatrices[1].scalarMultiply(v.getComponent(1))); 60 m=m.add(basisMatrices[2].scalarMultiply(v.getComponent(2))); 61 return (AbstractComplexSquareMatrix)m.scalarMultiply(Complex.I); 62 } 63 67 public AbstractDoubleVector multiply(final AbstractDoubleVector a, final AbstractDoubleVector b) { 68 if(!(a instanceof Double3Vector) || !(b instanceof Double3Vector)) 69 throw new VectorDimensionException("Vectors must be 3-vectors."); 70 return ((Double3Vector)a).multiply((Double3Vector)b); 71 } 72 75 public AbstractComplexSquareMatrix[] basis() { 76 return basisMatrices; 77 } 78 } 79 80
| Popular Tags
|