public abstract class BinaryProductStructure
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
ARG_NUM |
static int |
CIRCULAR |
int |
COMP_NUM |
java.lang.String[] |
components |
static int |
HYPERBOLIC |
static double |
ZERO_PRECISSION |
Constructor and Description |
---|
BinaryProductStructure() |
BinaryProductStructure(int comp_nr) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asString() |
java.lang.String |
asString(boolean with_blanks) |
void |
collectTerms()
Equal terms of the components are added or subtracted wherever possible.
|
void |
compressComponents()
Removes all blanks from components as they are algebraically redundant.
|
BinaryProductStructure |
conjugate() |
static BinaryProductStructure |
dual()
// TODO Implementation not clear, as we have to distinguish between a left- and
// a right dual ...
|
abstract java.lang.String[] |
getBasis() |
java.lang.String |
getBasisElementAsString(int n) |
java.lang.String |
getBasisElementsAsString() |
abstract BinaryProductStructure |
getClone() |
static java.util.HashSet<java.lang.String> |
getClosedPairsAsString(BinaryProductStructure[] h) |
java.lang.String |
getComponent(int comp_nr) |
java.lang.String[] |
getComponents() |
java.lang.String |
getComponentsAsString() |
java.lang.String |
getComponentsAsString(boolean with_blanks) |
static BinaryProductStructure |
getConjugate(BinaryProductStructure h) |
java.lang.String |
getDiagonalProducts() |
static BinaryProductStructure |
getDual(BinaryProductStructure h) |
static java.util.LinkedList<java.lang.String> |
getExpressionAsList(java.lang.String expression)
An expression is split up in respect to the summands.
|
java.lang.String |
getFormattedMultTable() |
BinaryProductStructure |
getHermitianConjugate()
The hermitian conjugate of a hypernumber H is defined as:
*H = *(S,S) = (*S,S) where S is the subalgebra from which the hypernumber is constructed
via a (Cayley-Dickson) doubling procedure.
|
static BinaryProductStructure |
getImaginaryPart(BinaryProductStructure h) |
static BinaryProductStructure |
getInstance(java.lang.Class class_) |
abstract java.lang.String[][] |
getMTab()
Multiplication table and basis *
|
static java.lang.String[][] |
getMultiplicationTableAsArray()
To be implemented in the classes that inherit from class 'Hypernumber'.
|
int |
getMultiplicativeOrder(BinaryProductStructure h,
int max_steps) |
int |
getMultiplicativeOrder(BinaryProductStructure h,
int mult_steps,
double zero_precision)
Multiplicative order n, defined by: {min n: h1*(h2^n) = l*h1} with l a scalar factor.
|
java.lang.String |
getMultTableDiagonal() |
static BinaryProductStructure |
getNegated(BinaryProductStructure h) |
abstract BinaryProductStructure |
getNewInstance() |
static java.lang.String |
getNextBitmap(java.lang.String bitmap)
Used for permuting a bitmap with n 1's.
|
java.lang.String |
getNonzeroComponentsNumbered() |
java.lang.String |
getNonzeroComponentsNumbered(boolean signed)
If the n-th component (numbering starting from 0) is non-zero, "n" is added to a list.
|
static java.lang.String[][] |
getNormedMultiplicationTable(java.lang.String[][] mult_table,
java.lang.String[] basis,
java.lang.String[] sub_basis)
A normed multiplication table is per definition a table where the base
elements are numbered according to the order of their occurrence
in the basis vector (integers running from 1 upwards).
|
static BinaryProductStructure |
getNormSquared(BinaryProductStructure h) |
double |
getNormSquaredAsValue()
REQUIRES: Invocation in numerical mode.
|
static int |
getNumberOfClosedElements(BinaryProductStructure[] h)
In case that the full set of elements is not closed under multiplication, it might be of interest
for how many of its elements this property is still given.
|
static int |
getNumberOfClosedPairs(BinaryProductStructure[] h)
For every posssible pair of the given set of hypernumbers it is checked if the prodeuct is again
contained in the set.
|
abstract int |
getNumberOfComponents() |
int |
getNumberOfNonzeroComponents() |
static BinaryProductStructure |
getNumericalInverse(BinaryProductStructure h)
The inverse of a hypernumber h is calculated.
|
static BinaryProductStructure |
getProduct(BinaryProductStructure h1,
BinaryProductStructure h2)
Multiplies two hypernummers according to the order of the arguments of the method.
|
static BinaryProductStructure |
getProductWithScalar(BinaryProductStructure h,
java.lang.String scalar) |
java.lang.String |
getPseudoScalarComponent() |
static BinaryProductStructure[] |
getRandomClosedPair(BinaryProductStructure[] h)
From the given set of hypernumbers a random pair is chosen (non trivial, i.a. the two elements
are supposed to be different).
|
static BinaryProductStructure[] |
getRandomNonClosedPair(BinaryProductStructure[] h)
From the given set of hypernumbers a random pair is chosen (non trivial, i.a. the two elements
are supposed to be different).
|
java.lang.String |
getScalarComponent() |
static java.util.HashSet<java.lang.String> |
getSubalgebras(java.lang.Class class_,
int order)
Determines all subalgebras of order n.
|
static java.lang.String |
getSubalgebrasAsString(java.lang.Class<?> class_,
int order) |
java.util.Collection<java.lang.String> |
getSubalgebrasSignatures(java.lang.Class<?> class_,
int order) |
static BinaryProductStructure |
getTrace(BinaryProductStructure h)
The trace of a hypernumber is defined as
tr(h) = h + conjugate(h) = 2*real part (h).
|
double |
getTraceRespDeterminant(BinaryProductStructure h) |
static BinaryProductStructure |
getVectorDerivative(BinaryProductStructure direction,
BinaryProductStructure function)
Derivative in direction of a vector 'a' for a hypernumber-valued function F:
(a*d)F with '*' being the inner product and 'd' a
|
static BinaryProductStructure |
getVectorProduct(BinaryProductStructure h1,
BinaryProductStructure h2)
The vector product "x" of two hypernumbers h1 and h2 is defined as
h1 x h2 = Im(Im(h1)*Im(h2)) = 0.5 [h1,h2]
It coincides with the conventional vector product in 3 dimensions for the
quaternions and the vector product in 7-dimensions for the
octonions.
|
boolean |
isAutomorphism(BinaryProductStructure x,
BinaryProductStructure y)
Checks if given hypernumber is related to the hypernumbers x, y via the automorphism map:
(a x a^{-1}) (a y a^{-1}) = l (a xy a^{-1}) with l a constant,
i.e. we do not require an appropriate normalisation of the hypernumbers.
|
boolean |
isCayleyDicksonLoop() |
boolean |
isComponentZero(int nr) |
static boolean |
isLinearlyDependent(BinaryProductStructure h1,
BinaryProductStructure h2,
boolean pos_and_neg)
Tests linear dependency, i.e. if h1 = c*h2 is satisfied, with "c" a (real) non-zero constant.
|
boolean |
isNumerical() |
static boolean |
isNumericalityDetected(BinaryProductStructure h)
Detects if all the components are numerical.
|
static boolean |
isProductClosed(BinaryProductStructure[] h)
REQUIRES: Mode must be set to numerical.
|
boolean |
isZero() |
BinaryProductStructure |
multiplyWithScalar(java.lang.String scalar)
Multiplication with a scalar.
|
BinaryProductStructure |
negate()
Negates the hypernumber: h --> -h.
|
void |
resetComponents()
Sets all components to zero.
|
BinaryProductStructure |
rightMultiplyWith(BinaryProductStructure h2) |
BinaryProductStructure |
rightMultiplyWith(BinaryProductStructure h,
boolean collect_terms)
Multiply with another hypercomplex number.
|
void |
setBasis(java.lang.String[] new_basis)
Sets the components of the hypercomplex number.
|
void |
setComponent(int n,
java.lang.String value)
Sets the value of a single component.
|
void |
setComponentAsBasisNames()
The designation of the basis elements is copied to the respective components.
|
void |
setComponentExclusively(int n,
java.lang.String value)
Sets the value of a single component.
|
void |
setComponents(java.lang.String components)
Sets the components of the hypercomplex number.
|
void |
setComponents(java.lang.String[] comps) |
void |
setIndexedComponents(java.lang.String component_name,
int start_index,
boolean imaginary_only)
REQUIRES: Only non-numerical mode allowed.
|
static void |
setMultiplicationTable(MultiplicationTable mult_table) |
static void |
setMultiplicationTable(java.lang.String[][] mult_table) |
static void |
setNumerical() |
static void |
setNumerical(boolean is_numerical) |
void |
setPseudoScalarComponent(java.lang.String scalar) |
void |
setRandomComponents(int n) |
void |
setRandomComponents(int n,
boolean is_imaginary) |
void |
setRandomComponents(int n,
boolean is_imaginary,
boolean numerical)
Assigns random components to the hypernumber.
|
void |
setRandomComponentsAll()
Sets all components randomly.
|
static void |
setRepresentation(java.lang.String representation)
Specifies the labeling of the basis elements.
|
void |
setScalarComponent(java.lang.String scalar) |
static void |
setSignTable(SignTable sign_table)
The signs of the multiplication table (i.e. the structure constants) are set.
|
void |
simplifyNumericalFactors()
For the components the factors of all terms separated by "+" or "-"
are moved to the front and are multiplied with one another.
|
void |
simplifyNumericalSummands()
Numerical summands are simplified, i.e. added or subtracted.
|
void |
simplifyPlusMinus()
Simplifies the components, replacing any adjacent "+"'s and "-"'s
according to:
"++" --> "+"
"+-" --> "-"
"-+" --> "-"
"--" --> "+"
|
BinaryProductStructure |
square() |
public static final int CIRCULAR
public static final int HYPERBOLIC
public static double ZERO_PRECISSION
public int COMP_NUM
public int ARG_NUM
public java.lang.String[] components
public BinaryProductStructure()
public BinaryProductStructure(int comp_nr)
public abstract BinaryProductStructure getClone()
public abstract int getNumberOfComponents()
public abstract BinaryProductStructure getNewInstance()
public static BinaryProductStructure getInstance(java.lang.Class class_) throws java.lang.InstantiationException, java.lang.IllegalAccessException
classname
- Class name.java.lang.IllegalAccessException
java.lang.InstantiationException
public abstract java.lang.String[][] getMTab()
public abstract java.lang.String[] getBasis()
public static java.lang.String[][] getMultiplicationTableAsArray() throws java.lang.Exception
java.lang.Exception
public static void setMultiplicationTable(java.lang.String[][] mult_table) throws java.lang.Exception
java.lang.Exception
public static void setMultiplicationTable(MultiplicationTable mult_table) throws java.lang.Exception
java.lang.Exception
public static void setRepresentation(java.lang.String representation) throws java.lang.Exception
representation
- Basis elements, comma delimited.java.lang.Exception
public static void setSignTable(SignTable sign_table) throws java.lang.Exception
sign_table
- Sign table.java.lang.Exception
public void setBasis(java.lang.String[] new_basis) throws java.lang.Exception
components
- E.g. the 8 components of an octonion, "x1,x2,x3,x4,x5,x6,x7,x8".java.lang.Exception
- Thrown if the argument is not valid.public java.lang.String getBasisElementsAsString()
public java.lang.String getBasisElementAsString(int n)
n
- Number of element (counting starts with 0).public java.lang.String getFormattedMultTable()
public void setComponents(java.lang.String components) throws java.lang.Exception
components
- E.g. the 8 components of an octonion, "x1,x2,x3,x4,x5,x6,x7,x8".java.lang.Exception
- Thrown if the argument is not valid.public void setIndexedComponents(java.lang.String component_name, int start_index, boolean imaginary_only) throws java.lang.Exception
component_name
- Name of component to be indexed.start_index
- Number from which indexing starts.imaginary_only
- Only imaginary components are considered.java.lang.Exception
public static void setNumerical()
public static void setNumerical(boolean is_numerical)
is_numerical
- 'true': Mathematical operations are carried out numerically.
'false': -- " -- algebraically.public boolean isNumerical()
public boolean isComponentZero(int nr) throws java.lang.Exception
nr
- Number of component (counting starting with "1").java.lang.Exception
public void setComponents(java.lang.String[] comps) throws java.lang.Exception
java.lang.Exception
public void setScalarComponent(java.lang.String scalar)
public java.lang.String getScalarComponent()
public void setPseudoScalarComponent(java.lang.String scalar)
public java.lang.String getPseudoScalarComponent()
public void resetComponents()
public void setComponent(int n, java.lang.String value) throws java.lang.Exception
n
- Component number (counting starts with "0").value
- Value.java.lang.Exception
public void setComponentAsBasisNames() throws java.lang.Exception
java.lang.Exception
public void setComponentExclusively(int n, java.lang.String value) throws java.lang.Exception
n
- Component number (counting starts with "0").value
- Value.java.lang.Exception
public java.lang.String[] getComponents()
public java.lang.String getComponent(int comp_nr)
comp_nr
- public java.lang.String getComponentsAsString()
public static boolean isNumericalityDetected(BinaryProductStructure h)
public java.lang.String getComponentsAsString(boolean with_blanks)
public void setRandomComponentsAll() throws java.lang.Exception
java.lang.Exception
public void setRandomComponents(int n) throws java.lang.Exception
java.lang.Exception
public void setRandomComponents(int n, boolean is_imaginary) throws java.lang.Exception
java.lang.Exception
public void setRandomComponents(int n, boolean is_imaginary, boolean numerical) throws java.lang.Exception
n
- Number of components to be set. The others are set to zero.is_imaginary
- Only imaginary components are set, i.e. the first component is ignored.numerical
- the components are numerical (doubles). If the hypernumber is set to
numerical anyhow, this flag is ignored.java.lang.Exception
public java.lang.String asString(boolean with_blanks)
no_blanks
- 'true' No blanks between summands.
'false' A blank between summands.public java.lang.String asString()
public static java.lang.String[][] getNormedMultiplicationTable(java.lang.String[][] mult_table, java.lang.String[] basis, java.lang.String[] sub_basis)
A
- sub table based on the sub basis is projected out.public BinaryProductStructure square() throws java.lang.Exception
java.lang.Exception
public double getNormSquaredAsValue() throws java.lang.Exception
java.lang.Exception
public static BinaryProductStructure getNormSquared(BinaryProductStructure h) throws java.lang.Exception
h
- Hypernumberjava.lang.Exception
public java.lang.String getMultTableDiagonal()
public java.lang.String getDiagonalProducts()
public BinaryProductStructure negate() throws java.lang.Exception
java.lang.Exception
public BinaryProductStructure conjugate() throws java.lang.Exception
java.lang.Exception
public static BinaryProductStructure getConjugate(BinaryProductStructure h) throws java.lang.Exception
java.lang.Exception
public static BinaryProductStructure dual() throws java.lang.Exception
java.lang.Exception
public static BinaryProductStructure getDual(BinaryProductStructure h) throws java.lang.Exception
java.lang.Exception
public BinaryProductStructure getHermitianConjugate() throws java.lang.Exception
java.lang.Exception
public int getMultiplicativeOrder(BinaryProductStructure h, int max_steps) throws java.lang.Exception
java.lang.Exception
public int getMultiplicativeOrder(BinaryProductStructure h, int mult_steps, double zero_precision) throws java.lang.Exception
h
- Hypernumbermult_steps
- Upper limit up to which multiplicative orders are tested.java.lang.Exception
public BinaryProductStructure multiplyWithScalar(java.lang.String scalar) throws java.lang.Exception
scalar
- Scalar.java.lang.Exception
public BinaryProductStructure rightMultiplyWith(BinaryProductStructure h2) throws java.lang.Exception
java.lang.Exception
public BinaryProductStructure rightMultiplyWith(BinaryProductStructure h, boolean collect_terms) throws java.lang.Exception
h2
- Hypercomplex number to be multiplied with.collect_terms
- true: Terms are added or subtracted if possible.
false: Terms are not added or subtracted. (This is interesting
if they contain functions and differential operators
for which the order is relevant. The simplification procedure
ignores the order).java.lang.Exception
public static BinaryProductStructure getNegated(BinaryProductStructure h) throws java.lang.Exception
java.lang.Exception
public static BinaryProductStructure getImaginaryPart(BinaryProductStructure h) throws java.lang.Exception
h
- Hypernumberjava.lang.Exception
public static BinaryProductStructure getProduct(BinaryProductStructure h1, BinaryProductStructure h2) throws java.lang.Exception
h1
- Hypermummer 1.h2
- Hypernummer 2.java.lang.Exception
public static BinaryProductStructure getProductWithScalar(BinaryProductStructure h, java.lang.String scalar) throws java.lang.Exception
java.lang.Exception
public static BinaryProductStructure getTrace(BinaryProductStructure h) throws java.lang.Exception
h
- Hypermummer.java.lang.Exception
public static BinaryProductStructure getVectorDerivative(BinaryProductStructure direction, BinaryProductStructure function)
direction
- function
- public static boolean isLinearlyDependent(BinaryProductStructure h1, BinaryProductStructure h2, boolean pos_and_neg)
h1
- Hypernumber 1.h2
- Hypernumber 2.r
- pos_and_neg true: "c" may be positive and negative.
false: Only positive values for "c" are allowed.
REQUIRES: Mode must be set to numerical.public static BinaryProductStructure getVectorProduct(BinaryProductStructure h1, BinaryProductStructure h2) throws java.lang.Exception
h1
- Hypernumber 1.h2
- Hypernumber 2.java.lang.Exception
public boolean isZero()
public static boolean isProductClosed(BinaryProductStructure[] h) throws java.lang.Exception
h
- Hypermumbers.java.lang.Exception
public static BinaryProductStructure[] getRandomClosedPair(BinaryProductStructure[] h) throws java.lang.Exception
h
- Hypernumbers.java.lang.Exception
public static BinaryProductStructure[] getRandomNonClosedPair(BinaryProductStructure[] h) throws java.lang.Exception
h
- Hypernumbers.java.lang.Exception
public static int getNumberOfClosedElements(BinaryProductStructure[] h) throws java.lang.Exception
h
- Hypernumbers.java.lang.Exception
- Number of elements of a subset that is closed under multiplication in respect
to the full set.public static int getNumberOfClosedPairs(BinaryProductStructure[] h) throws java.lang.Exception
h
- Hypernumbers.java.lang.Exception
- Number of pairs of elements of the given set of hypernumbers that is closed under
multiplication in respect to the full set.public static java.util.HashSet<java.lang.String> getClosedPairsAsString(BinaryProductStructure[] h) throws java.lang.Exception
java.lang.Exception
public boolean isAutomorphism(BinaryProductStructure x, BinaryProductStructure y) throws java.lang.Exception
x
- Hypernumber.y
- Hypernumber.java.lang.Exception
public int getNumberOfNonzeroComponents()
java.lang.Exception
public java.lang.String getNonzeroComponentsNumbered(boolean signed)
signed
- If true, a "-" is added if component < 0.public java.lang.String getNonzeroComponentsNumbered()
public static java.util.HashSet<java.lang.String> getSubalgebras(java.lang.Class class_, int order) throws java.lang.Exception
order
- Order.java.lang.Exception
java.lang.Exception
public static java.lang.String getSubalgebrasAsString(java.lang.Class<?> class_, int order) throws java.lang.Exception
java.lang.Exception
public java.util.Collection<java.lang.String> getSubalgebrasSignatures(java.lang.Class<?> class_, int order) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getNextBitmap(java.lang.String bitmap)
bitmap
- Bitmap of 0's and 1's, e.g. "010010010".public static java.util.LinkedList<java.lang.String> getExpressionAsList(java.lang.String expression)
expression
- Expression consisting of terms.public void simplifyPlusMinus()
public void simplifyNumericalFactors()
public void simplifyNumericalSummands()
public void collectTerms()
public double getTraceRespDeterminant(BinaryProductStructure h)
public static BinaryProductStructure getNumericalInverse(BinaryProductStructure h) throws java.lang.NumberFormatException, java.lang.Exception
h
- Hypernumberjava.lang.NumberFormatException
java.lang.Exception
public void compressComponents()
public boolean isCayleyDicksonLoop()