1 package JSci.maths.groups; 2 3 import JSci.maths.*; 4 import JSci.maths.vectors.AbstractDoubleVector; 5 import JSci.maths.matrices.AbstractComplexMatrix; 6 import JSci.maths.matrices.AbstractComplexSquareMatrix; 7 import JSci.maths.matrices.ComplexDiagonalMatrix; 8 9 17 public class LieGroup extends Object { 18 private AbstractComplexSquareMatrix generators[]; 19 private AbstractComplexSquareMatrix identityMatrix; 20 24 public LieGroup(AbstractComplexSquareMatrix gens[]) { 25 generators=gens; 26 identityMatrix=ComplexDiagonalMatrix.identity(generators[0].rows()); 27 } 28 31 public final int dimension() { 32 return generators.length; 33 } 34 38 public AbstractComplexSquareMatrix getElement(AbstractDoubleVector v) { 39 if(generators.length!=v.dimension()) 40 throw new IllegalArgumentException ("The vector should match the generators."); 41 AbstractComplexMatrix phase=generators[0].scalarMultiply(v.getComponent(0)); 42 for(int i=1;i<generators.length;i++) 43 phase=phase.add(generators[i].scalarMultiply(v.getComponent(i))); 44 return (AbstractComplexSquareMatrix)identityMatrix.add(phase.scalarMultiply(Complex.I)); 45 } 46 49 public AbstractComplexSquareMatrix identity() { 50 return identityMatrix; 51 } 52 56 public final boolean isIdentity(AbstractComplexSquareMatrix a) { 57 return identityMatrix.equals(a); 58 } 59 64 public final boolean isInverse(AbstractComplexSquareMatrix a,AbstractComplexSquareMatrix b) { 65 return isIdentity(a.multiply(b)); 66 } 67 } 68 69 | Popular Tags |