All Downloads are FREE. Search and download functionalities are using the official Maven repository.

JSci.maths.groups.U1 Maven / Gradle / Ivy

Go to download

JSci is a set of open source Java packages. The aim is to encapsulate scientific methods/principles in the most natural way possible. As such they should greatly aid the development of scientific based software. It offers: abstract math interfaces, linear algebra (support for various matrix and vector types), statistics (including probability distributions), wavelets, newtonian mechanics, chart/graph components (AWT and Swing), MathML DOM implementation, ... Note: some packages, like javax.comm, for the astro and instruments package aren't listed as dependencies (not available).

The newest version!
package JSci.maths.groups;

import JSci.maths.Complex;
import JSci.maths.matrices.AbstractComplexSquareMatrix;
import JSci.maths.matrices.ComplexDiagonalMatrix;

/**
* The U1 class provides an encapsulation for U(1) groups.
* Unlike the parent LieGroup class, elements are not limited to
* being near the identity.
* The methods in this class assume a complex number representation
* for convenience.
* The LieGroup methods still provide a matrix representation.
* @version 1.3
* @author Mark Hale
*/
public final class U1 extends LieGroup {
        private static final AbstractComplexSquareMatrix U1gens[]={ComplexDiagonalMatrix.identity(1)};

        private static final U1 _instance = new U1();
        /**
        * Constructs a U(1) group.
        */
        private U1() {
                super(U1gens);
        }
        /**
        * Constructs a U(1) group.
        * Singleton.
        */
        public static final U1 getInstance() {
                return _instance;
        }
        /**
        * Returns a string representing this group.
        */
        public String toString() {
                return "U(1)";
        }
        /**
        * Returns an element from within the group.
        * @param param parameter to specify the group element
        */
        public Complex getElement(double param) {
                return Complex.polar(1.0,param);
        }
        /**
        * Returns true if the element is the identity element of this group.
        * @param a a group element
        */
        public boolean isIdentity(Complex a) {
                return Complex.ONE.equals(a);
        }
        /**
        * Returns true if one element is the inverse of the other.
        * @param a a group element
        * @param b a group element
        */
        public boolean isInverse(Complex a,Complex b) {
                return Complex.ONE.equals(a.multiply(b));
        }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy