ddg.geometry.signatures module
- class ddg.geometry.signatures.Signature(plus: int, minus: int, zero: int = 0)[source]
Bases:
objectProjective signature class.
Two projective signatures are equal if and only if quadrics with those signatures are related by a projective transformation.
We want to identify:
Signatures
Quadrics up to projective transformation
“Normalized matrices” up to nonzero scalar multiplication (-1 in particular), which will be the result of e.g.
projective_normalization().
To achieve this, we define a normalized matrix as a diagonal matrix
I_n | | -----|------|--- | -I_m | -----|------|--- | | 0or
-I_n | | ------|-----|--- | I_m | ------|-----|--- | | 0where
I_nis the (n x n)-identity matrix, 0 means a 0 matrix andn >= m.- Parameters:
- plusint
- minusint
- zeroint (default=0)
These three arguments mean the number of 1, -1, 0 on the diagonal.
Notes
This class implements the equals relation
==, with the meaning explained above.It is also hashable.
Examples
>>> from ddg.geometry.signatures import Signature >>> sgn1 = Signature(2, 1, 0) >>> sgn1 Signature(plus=2, minus=1, zero=0) >>> sgn2 = Signature(1, 2, 0) >>> sgn2 Signature(plus=1, minus=2, zero=0) >>> sgn1 == sgn2 True >>> sgn1.matrix array([[ 1, 0, 0], [ 0, 1, 0], [ 0, 0, -1]]) >>> sgn2.matrix array([[-1, 0, 0], [ 0, -1, 0], [ 0, 0, 1]]) >>> sgn1.is_degenerate False >>> sgn1.rank 3 >>> sgn1.is_positive_definite False >>> sgn3 = Signature(2, 1, 1) >>> sgn3 Signature(plus=2, minus=1, zero=1) >>> sgn3.matrix array([[ 1, 0, 0, 0], [ 0, 1, 0, 0], [ 0, 0, -1, 0], [ 0, 0, 0, 0]]) >>> sgn1 == sgn3 False
- plus: int
- minus: int
- zero: int = 0
- property matrix
Returns the normalized matrix corresponding to the signature.
See the class docstring for how this is defined.
This method respects the global sign the signature is initialized with, even though the equality operator does not.
- Returns:
- numpy.ndarray of shape (n, n)
- property is_degenerate
Whether this is the signature of a degenerate quadric.
- Returns:
- bool
- property rank
Rank of associated matrix.
- Returns:
- int
- property is_positive_definite
Whether the signature is positive definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) > 0for allp != 0.- Returns:
- bool
- property is_negative_definite
Whether the signature is negative definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) < 0for allp != 0.- Returns:
- bool
- property is_positive_semi_definite
Whether the signature is positive semi-definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) >= 0for allp.- Returns:
- bool
- property is_negative_semi_definite
Whether the signature is negative semi-definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) <= 0for allp.- Returns:
- bool
- property is_indefinite
Whether the signature is indefinite.
Meaning, that a quadratic form with this signature, can have both positive and negative values.
- Returns:
- bool
- property is_definite
Whether the signature is either positive or negative definite.
- Returns:
- bool
- property is_semi_definite
Whether the signature is either positive or negative semi-definite.
- Returns:
- bool
- class ddg.geometry.signatures.AffineSignature(plus: int, minus: int, zero: int = 0, last_entry: Literal[0, 1, -1, 'parabolic']] = None)[source]
Bases:
SignatureAffine signature class.
Two affine signatures are equal if and only if quadrics with those signatures are related by an affine transformation.
We want to identify:
Affine signatures
Quadrics up to affine transformation
“Normalized matrices” up to nonzero scalar multiplication (-1 in particular), which will be the result of e.g.
affine_normalization().
To achieve this, we define what a normalized matrix is as follows:
In the non-parabolic case: A diagonal matrix with only 1, -1 and 0 on the diagonal. The diagonal looks as follows (where
sis either 1, -1 or 0):If the last entry on the diagonal is 0:
(s,...,s, -s,...,-s, 0,...,0), and the number ofs’s is greater than or equal to the number of-s’s.If the last entry on the diagonal is
s != 0:(s,...,s, -s,...,-s, 0,...,0, s).
In the parabolic case: a matrix of the form
D | --+----- | 0 s | s 0
where
Dis a diagonal matrix with only 1, -1 and 0 on the diagonal. The diagonal is sorted in the orders,-s,0and the number ofs’s is greater than or equal to the number of-s’s.Note that for parabolic cases, flipping the sign of the diagonal is the same as flipping the sign of the off-diagonal entries, which as an affine transformation is a reflection about the plane
x[-2] = 0.- Parameters:
- plusint
- minusint
- zeroint (default=0)
These three arguments mean the number of 1, -1 or 0 on the diagonal of the diagonalized matrix. Note that for parabolic cases, these will not be the counts on the diagonal: A 1 and a -1 will be replaced by a 0 and entries on the off-diagonal, see above.
- last_entry1, -1, 0 or “parabolic” (default=None)
The last entry on the diagonal. A value of “parabolic” means the matrix
0 1 1 0
See above for details. This can be omitted (left as
None) if only one ofplus,minusorzerois nonzero.
- Raises:
- ValueError
If
last_entryis “parabolic” andplusorminusare 0.If
last_entrywas not given and could not be inferred uniquely.If
last_entrywas given and is not 1, -1, 0 or ‘parabolic’.
Notes
This class implements the equals relation
==, with the meaning explained above.It is also hashable.
Examples
>>> from ddg.geometry.signatures import AffineSignature >>> sgn1 = AffineSignature(2, 1, 0, last_entry=-1) >>> sgn1.matrix array([[ 1, 0, 0], [ 0, 1, 0], [ 0, 0, -1]]) >>> sgn2 = AffineSignature(1, 2, 0, last_entry=1) >>> sgn2 AffineSignature(plus=1, minus=2, zero=0, last_entry=1) >>> sgn2.matrix array([[-1, 0, 0], [ 0, -1, 0], [ 0, 0, 1]]) >>> sgn1 == sgn2 True >>> sgn3 = AffineSignature(1, 2, 0, last_entry=-1) >>> sgn3.matrix array([[-1, 0, 0], [ 0, 1, 0], [ 0, 0, -1]]) >>> sgn3 == sgn2 False >>> sgn4 = AffineSignature(1, 2, 0, last_entry="parabolic") >>> sgn4 AffineSignature(plus=1, minus=2, zero=0, last_entry='parabolic') >>> sgn4.matrix array([[-1, 0, 0], [ 0, 0, -1], [ 0, -1, 0]]) >>> sgn3 == sgn4 False
- plus: int
- minus: int
- zero: int = 0
- last_entry: Literal[0, 1, -1, 'parabolic']] = None
- property matrix
Return normalized matrix corresponding to the signature.
See the class docstring for how this is defined.
- Returns:
- numpy.ndarray of shape (n, n)
Notes
This method respects the sign the signature is initialized with, even though the equality operator does not.
- property is_definite
Whether the signature is either positive or negative definite.
- Returns:
- bool
- property is_degenerate
Whether this is the signature of a degenerate quadric.
- Returns:
- bool
- property is_indefinite
Whether the signature is indefinite.
Meaning, that a quadratic form with this signature, can have both positive and negative values.
- Returns:
- bool
- property is_negative_definite
Whether the signature is negative definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) < 0for allp != 0.- Returns:
- bool
- property is_negative_semi_definite
Whether the signature is negative semi-definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) <= 0for allp.- Returns:
- bool
- property is_positive_definite
Whether the signature is positive definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) > 0for allp != 0.- Returns:
- bool
- property is_positive_semi_definite
Whether the signature is positive semi-definite.
Meaning, if
qis a quadratic form with this signature,q(p,p) >= 0for allp.- Returns:
- bool
- property is_semi_definite
Whether the signature is either positive or negative semi-definite.
- Returns:
- bool
- property rank
Rank of associated matrix.
- Returns:
- int
- ddg.geometry.signatures.signature_from_diagonal(diag)[source]
Create signature from diagonal.
- Parameters:
- diagarray_like of shape (n,)
1D array containing only 1, -1 and 0.
- Returns:
- Signature
- Raises:
- ValueError
If
diagcontains entries other than 1, -1 or 0.
Examples
>>> from ddg.geometry.signatures import signature_from_diagonal >>> signature_from_diagonal((1, 0, 1)) Signature(plus=2, minus=0, zero=1) >>> signature_from_diagonal((0, -1, -1)) Signature(plus=0, minus=2, zero=1) >>> signature_from_diagonal((1, 1, 0, 0, -1, 0)) Signature(plus=2, minus=1, zero=3)
- ddg.geometry.signatures.affine_signature_from_diagonal(diag, parabolic=False)[source]
Create affine signature from diagonal.
- Parameters:
- diagarray_like of shape (n,) or list
1D array containing only 1, -1 and 0. If
parabolicis True, this must have 0 at entries -1 and -2.- parabolicbool (default=False)
- Returns:
- AffineSignature
- Raises:
- ValueError
If
diagcontains entries other than 1, -1 or 0.If
parabolicis True anddiagdoes not have 0 at positions -1 and -2.
Examples
>>> from ddg.geometry.signatures import affine_signature_from_diagonal >>> affine_signature_from_diagonal((1, 0, 1)) AffineSignature(plus=2, minus=0, zero=1, last_entry=1) >>> affine_signature_from_diagonal((0, -1, -1)) AffineSignature(plus=0, minus=2, zero=1, last_entry=-1) >>> affine_signature_from_diagonal((1, 1, 0, 0, -1, 0)) AffineSignature(plus=2, minus=1, zero=3, last_entry=0)
- ddg.geometry.signatures.projective_normalization(Q, atol=None, rtol=None)[source]
Bring quadric to normal form by projective transformation.
Returns signature
sgnand transformation matrixAsuch thatA.T @ Q @ A == sgn.matrix
See
Signaturefor more information.Note that this means that the point transformation defined by A transforms
sgn.matrixinto Q.- Parameters:
- Qnumpy.ndarray
Symmetric matrix.
- atol, rtolfloat (default=None)
This function uses the global tolerance defaults if
atolorrtolare set to None. Seeddg.nonexactfor details.
- Returns:
- sgnSignature
- Anumpy.ndarray
Transformation matrix.
- Raises:
- ValueError
If
Qis not symmetric.
Examples
>>> import numpy as np >>> from ddg.geometry.signatures import projective_normalization >>> Q = np.array([[10, 0, 0], [0, 5, 0], [0, 0, 3]]) >>> Q array([[10, 0, 0], [ 0, 5, 0], [ 0, 0, 3]]) >>> sgn, A = projective_normalization(Q) >>> sgn Signature(plus=3, minus=0, zero=0) >>> A array([[0.31622777, 0. , 0. ], [0. , 0.4472136 , 0. ], [0. , 0. , 0.57735027]]) >>> B = np.array([[1, 0, 2], [0, 5, 0], [2, 0, 3]]) >>> B array([[1, 0, 2], [0, 5, 0], [2, 0, 3]]) >>> sgn, A = projective_normalization(B) >>> sgn Signature(plus=2, minus=1, zero=0) >>> A array([[ 0. , -0.25543607, -1.75078485], [-0.4472136 , 0. , 0. ], [ 0. , -0.41330424, 1.08204454]])
- ddg.geometry.signatures.affine_normalization(Q, atol=None, rtol=None)[source]
Bring quadric to normal form by affine transformation.
Returns affine signature
sgnand affine transformationAsuch thatA.T @ Q @ A == sgn.matrix
For non-parabolic cases, this means diagonalizing
Qwith an affine transformation such that there is only 1, -1 or 0 on the diagonal. For parabolic cases, normalizes to a matrix of the formD1 | (+/-) ---+----- | 0 1 | 1 0Where
D1is a diagonal matrix with only 1, -1 or 0 on the diagonal. For more information about the order of entries on the diagonal etc, seeAffineSignature.- Parameters:
- Qnumpy.ndarray of shape (n + 1, n + 1)
Symmetric matrix. Can be interpreted as a quadric in n-dim. projective space.
- atol, rtolfloat (default=None)
This function uses the global tolerance defaults if
atolorrtolare set to None. Seeddg.nonexactfor details.
- Returns:
- sgnAffineSignature
- Anumpy.ndarray of shape (n + 1, n + 1)
Affine transformation.
- Raises:
- ValueError
If
Qis not symmetric.
See also
ddg.math.symmetric_matrices.AffineSignature
Notes
For a detailed explanation of the implementation, see supplemental material.
Examples
>>> import numpy as np >>> from ddg.geometry.signatures import affine_normalization >>> Q = np.array([[10, 0, 0], [0, 5, 0], [0, 0, 3]]) >>> Q array([[10, 0, 0], [ 0, 5, 0], [ 0, 0, 3]]) >>> sgn, A = affine_normalization(Q) >>> sgn AffineSignature(plus=3, minus=0, zero=0, last_entry=1) >>> A array([[0.31622777, 0. , 0. ], [0. , 0.4472136 , 0. ], [0. , 0. , 0.57735027]]) >>> B = np.array([[1, 0, 2], [0, 5, 0], [2, 0, 3]]) >>> B array([[1, 0, 2], [0, 5, 0], [2, 0, 3]]) >>> sgn, A = affine_normalization(B) >>> sgn AffineSignature(plus=2, minus=1, zero=0, last_entry=-1) >>> A array([[ 0. , 1. , -2. ], [ 0.4472136, 0. , 0. ], [ 0. , 0. , 1. ]])
- class ddg.geometry.signatures.SignatureSequence(indices, signatures, multiplicities)[source]
Bases:
objectSignature sequence class
Signature sequences can be used to classify non-degenerate pencils (ddg.geometry.Pencil) of real quadrics (ddg.geometry.Quadric).
If the pencil is represented as:
P(Q1,Q2) = lambda Q2 + Q1
with
A, Breal symmetric matrices representing the quadrics spanning the pencil, and we consider the rootslambda_lof:det(lambda Q2 + Q1) = 0
then the signature sequence is calculated as:
[v_1, (...(i_1, j_1)...), v_2, ...., v_k-1, (...(i_k-1, j_k-1)...), v_k],
where
v_lare the index of the nonsingular matriceslambda Q2 + Q1between two roots and(...(i_l, j_l)...)are the signatures of the singular matriceslambda_l Q2 + Q1, with the multiplicity of the root being represented in the number of bracketsA number of operations can be performed on the attributes of a signature sequence to receive an equivalent sequence:
rotate_left(indices, signatures, multiplicities)
rotate_right(indices, signatures, multiplicities)
inverse_order(indices, signatures, multiplicities)
find_complement(indices, signatures, multiplicities)
If the dimension of the sequence is 4 (
RP³), the sequence can be brought into normalform for classification via equivalence operations.Normalform is reached by the following rules in descending order of importance:
multiple roots to the front
smallest values to the front
smallest sum of values possible for indices
more positive than negative entries in signatures
- Parameters:
- indices: tuple or list of integers
Indexes of the non-degenerate quadrics in the pencil, given in an arbitrary order (but fitting for the other tuples)
- signatures: tuple or list of Signature
Signatures of the degenerate quadrics in the pencil
- multiplicities: tuple or list of integers
Multiplicities of the roots in the characteristic function
det(lambda Q2 + Q1)=0wherelambda Q2 + Q1describes the pencil
- Raises:
- ValueError
- If the tuples are not of the correct lengths
len(indices)-1=len(signatures)=len(multiplicities)
If the tuples are not filled with the right type of entries:
indices: integers
signatures: signatures
multiplicities: integers
See also
Notes
This class supports the following operators:
==, meaning equivalency of the signature sequences, reached through aprojective transformation on lambda
- Attributes:
- dimension: int
- indices: tuple
- signatures: tuple
- multiplicities: tuple
- normalform()[source]
Calculates the canonical form of the Signature sequence if the sequence is of dimension 4 (3 dimensional projective space)
Normalform is reached by the following rules in descending order of importance:
multiple roots to the front
smallest values to the front
smallest sum of values possible for indices
more positive than negative entries in signatures
The function returns an equivalent signature sequence.
- Returns:
- ddg.geometry.signatures.SignatureSequence
in canonical form
- Raises:
- NotImplementedError
if the signature sequence is not of dimension 4
See also
- class ddg.geometry.signatures.JordanBlock(size, epsilon)[source]
Bases:
objectJordanBlock class
Jordanblocks
Jare quadratic blocks in the Jordannormalform of a matrixM. They have the form:| u 1 | | . . | J = | . . | | . 1 | | u |where
uis an eigenvalue ofM.- Parameters:
- size: int
Size of the jordanblock. If
Jis of sizenxn, size =n- epsilon: 1, -1
denotes whether the jordanblock has a positive or negative factor epsilon in the canonical form of a pencil.
- Raises:
- ValueError
If the Parameters are not of the correct type
- Attributes:
- size
- epsilon
- class ddg.geometry.signatures.IndexSequence(indices, jordanblocks)[source]
Bases:
objectIndex sequence class
Index sequences can be used to classify non-degenerate pencils (ddg.geometry.Pencil) of real quadrics (ddg.geometry.Quadric).
If the pencil is represented as:
P(Q1,Q2) = lambda Q2 + Q1
with
A, Breal symmetric matrices representing the quadrics spanning the pencil, and we consider the roots lambda_l of:det(lambda Q2 + Q1) = 0
then the signature sequence is calculated as:
[v_1 | v_2, ...., v_k-1 | v_k]
where
v_lare the index of the nonsingular matriceslambda Q2 + Q1between two roots and|is a placeholder for an array of symbols denoting the sizes and numbers of Jordan blocks in the quadric pair canonical form of the singular matrices:lambda_l Q2 + Q1
where
´´|´´ JordanBlock of size 1
- ´´≀…≀₊´´ JordanBlock of size n (number of wavy lines)
(with positive sign in the quadric pair canonical form)
- ´´≀…≀₋´´ JordanBlock of size n (number of wavy lines)
(with negative sign in the quadric pair canonical form)
(The quadric pair canonical form is calculated as follows: If
Q2is non-singular andQ2⁻¹Q1has JordannormalformJ=diag(J_1,..., J_n), thenQ2, Q1are simultaneously congruent to:diag(±E_1, ..., ±E_n), diag(±E_1J_1, ..., ±E_nJ_n),
where
E_iis a matrix of the form:| 1 | | . | | . | | . | | 1 |)
A number of operations can be performed on the attributes of an index sequence to receive an equivalent sequence:
rotate_left(indices, signatures, multiplicities)
rotate_right(indices, signatures, multiplicities)
inverse_order(indices, signatures, multiplicities)
find_complement(indices, signatures, multiplicities)
If the dimension of the sequence is 4 (
RP³), the sequence can be brought into normalform for classification via equivalence operations.Normalform is reached by the following rules in descending order of importance:
multiple roots to the front
smallest values to the front
smallest sum of values possible for indices
more negative than positive signs for the Jordanblocks
- Parameters:
- indices: tuple or list of integers
Indexes of the non-degenerate quadrics in the pencil given in an arbitrary order (but fitting for the other tuples)
- jordanblocks: tuple or list of tuples or lists of JordanBlock
Sizes of the Jordanblocks in the canonical form of matrices in the pencil corresponding to roots in the characteristic function
det(lambda Q2 + Q1)=0wherelambda Q2 + Q1describes the pencil
- Raises:
- ValueError
- If the tuples are not of the correct lengths
(len(indices)-1=len(jordanblocks))
If the tuples are not filled with the right type of entries:
indices: integers
jordanblocks: lists
elements of jordanblocks: JordanBlock
Notes
This class supports the following operators:
- -
==, meaning equivalency of the index sequences, reached through a projective transformation on lambda
- Attributes:
- indices: tuple
- jordanblocks: tuple
- dimension: int
calculated by sum of first and last index dim = indices[0]+ indices[-1]
- multiplicities: tuple
calculated from the tuple of jordanblocks
- normalform()[source]
Calculates the canonical form of the index sequence if the sequence is of dimension 4 (3 dimensional projective space)
Normalform is reached by the following rules in descending order of importance:
multiple roots to the front
smallest values to the front
smallest sum of values possible for indices
more positive than negative entries in signatures
The function returns an equivalent signature sequence.
- Returns:
- ddg.geometry.signatures.IndexSequence
in canonical form
- Raises:
- NotImplementedError
if the signature sequence is not of dimension 4
See also
- class ddg.geometry.signatures.SegreSymbol(roots, reals)[source]
Bases:
objectSegre symbol class
The Segre symbol is defined for representative matrices for a pencil of quadrics (ddg.geometry.Pencil). Two projectively equivalent pencils have matrices with the same Segre Symbol. As such, the Segre symbol can be calculated from the Smith normal form (SNF) of blocks of type:
| 1 | | a | | . | | . 1 | Q2= | . | , Q1= | . . | | . | | . . | | 1 | | a 1 |in the polynomial matrix
`lambda Q2 + Q1representing the pencil (see Jordannormalform for IndexSequence). SNF of blocklambda Q2_i + Q1_i(lambda_i):| 1 | | . | | . | | 1 | | (lambda-lambda_i)^(v_ij) |
The Segree symbol is then the combination of the information of all blocks in the form:
[(v_11, ..., v_1r1), ..., (v_n1, ..., v_nrn)]_k
with the
v_ijthe exponents in the SNF andkthe number of reallambda_iin the symbol (counted with multiplicity). Thev_ijalso denote the sizes of Jordanblocks in the Jordannormalform and hence the multiplicity of the roots of the characteristic equation of the pencil:det (lambda Q2 + Q1)=0
- Parameters:
- roots: list of integers
Multiplicities of the roots of the characteristic equation of the pencil (
det (lambda Q2 + Q1)=0) , given in an arbitrary order- reals: int
Number of real roots among those
- Raises:
- ValueError
If we don’t get the right type of parameter: list and integer
- If the list is not filled with the right type of entries:
lists of lists of integers
See also
- Attributes:
- roots
- reals
- normalform()[source]
Calculates the canonical form of the segre symbol
- Normalform is reached by the following rules:
lists of roots sorted in descending order
longest lists of roots to the front
lists of same length sorted by their entries, highest in the front
- Returns:
- ddg.geometry.signatures.SegreSymbol
in canonical form
- ddg.geometry.signatures.rotate_left(indices, signatures_jordanblocks, multiplicities)[source]
Rotate Signature and Index sequences one step to the left to create a projectively equivalent sequence
The second index goes to the first spot, the first index and first signature/jordanblock are thrown out. As new last signature/jordanblock, the inverse of the thrown out signature/jordanblock gets used. As new last index the ambient dimension minus the new first entry gets used.
- Parameters:
- indices: tuple
indices of the sequence
- signatures_jordanblocks: tuple
signatures for signature sequence jordanblocks for index sequence
- multiplicities: tuple
multiplicities of sequence
- Returns:
- tuple of three entries of type tuple
- ddg.geometry.signatures.rotate_right(indices, signatures_jordanblocks, multiplicities)[source]
Rotate Signature and Index sequences one step to the right to create a projectively equivalent sequence
The second to last index goes to the last spot, the last index and last signature/jordanblock are thrown out. As new first signature/jordanblock, the inverse of the thrown out signature/jordanblock gets used. As new first index the ambient dimension minus the new last entry gets used.
- Parameters:
- indices: tuple
indices of the sequence
- signatures_jordanblocks: tuple
signatures for signature sequence jordanblocks for index sequence
- multiplicities: tuple
multiplicities of sequence
- Returns:
- tuple of three entries of type tuple
- ddg.geometry.signatures.inverse_order(indices, signatures_jordanblocks, multiplicities)[source]
Inverses the order of a Signature and Index sequence to create a projectively equivalent sequence. Note that signatures stay unchanged while in the jordanblocks the epsilon changes exactly for blocks of odd size.
- Parameters:
- indices: tuple
indices of the sequence
- signatures_jordanblocks: tuple
signatures for signature sequence jordanblocks for index sequence
- multiplicities: tuple
multiplicities of sequence
- Returns:
- tuple of three entries of type tuple
- ddg.geometry.signatures.find_complement(indices, signatures_jordanblocks, multiplicities)[source]
Inverse the orientation of a Signature or Index sequence to create a projectively equivalent sequence
every index n gets turned into d- n, where d is the ambient dimension, every signature gets replaced by its inverse (plus and minus entry reversed) every jordanblock gets replaced by the same jordanblock with negative sign
- Parameters:
- indices: tuple
indices of the sequence
- signatures_jordanblocks: tuple
- - signatures for signature sequence
- - jordanblocks for index sequence
- multiplicities: tuple
multiplicities of sequence
- Returns:
- tuple of three entries of type tuple
- ddg.geometry.signatures.sort_by_signature(indices, signatures, multiplicities)[source]
Makes first signature have the highest plus value possible
- Parameters:
- indices: tuple
indices of the sequence
- signatures: tuple
signatures for signature sequence
- multiplicities: tuple
multiplicities of sequence
- Returns:
- tuple of three entries of type tuple
See also
threes_into_ones
- ddg.geometry.signatures.sort_by_jordanblock(indices, jordanblocks, multiplicities)[source]
Makes the number of negative jordanblocks maximal
- Parameters:
- indices: tuple
indices of the sequence
- jordanblocks: tuple
signatures for signature sequence
- multiplicities: tuple
multiplicities of sequence
- Returns:
- tuple of three entries of type tuple
See also
threes_into_ones
- ddg.geometry.signatures.normalform(indices, signatures_jordanblocks, multiplicities)[source]
Brings sequence into the normalform
Normalform is reached by the following rules in descending order of importance:
multiple roots to the front
smallest values to the front
smallest sum of values possible for indices
more positive than negative entries in signatures
The function returns an equivalent signature/index sequence.
- Parameters:
- indices: tuple
indices of the sequence
- signatures_jordanblocks: tuple
signatures for signature sequence jordanblocks for index sequence
- multiplicities: tuple
multiplicities of sequence
- Returns:
- tuple of three entries of type tuple
- Raises:
- NotImplementedError
if the dimension of the sequence isn’t four
- ddg.geometry.signatures.complete_types_dictionary()[source]
Completes the ddg.geometry.signatures.types_to_index_and_segre dictionary with the corresponding ddg.geometry.SignatureSequence
The resulting dictionary has entries of the form: “typeN”: [ ddg.geometry.signatures.SignatureSequence, ddg.geometry.signatures.IndexSequence, ddg.geometry.signatures.SegreSymbol ]
- Returns:
- dict