DGCV 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of DGCV might be problematic. Click here for more details.

Files changed (59) hide show
  1. dgcv-0.2.3/PKG-INFO +46 -0
  2. dgcv-0.2.3/README.md +32 -0
  3. {dgcv-0.2.2 → dgcv-0.2.3}/pyproject.toml +20 -1
  4. {dgcv-0.2.2 → dgcv-0.2.3}/setup.cfg +1 -1
  5. {dgcv-0.2.2 → dgcv-0.2.3}/setup.py +5 -9
  6. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/CRGeometry.py +195 -86
  7. dgcv-0.2.3/src/DGCV/DGCVFormatter.py +305 -0
  8. dgcv-0.2.2/src/DGCV/classesAndVariables.py → dgcv-0.2.3/src/DGCV/DGCore.py +4173 -2837
  9. dgcv-0.2.3/src/DGCV/RiemannianGeometry.py +1166 -0
  10. dgcv-0.2.2/src/DGCV/DGCV_display.py → dgcv-0.2.3/src/DGCV/_DGCV_display.py +58 -37
  11. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/__init__.py +116 -14
  12. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/_safeguards.py +99 -33
  13. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/combinatorics.py +117 -88
  14. dgcv-0.2.3/src/DGCV/complexStructures.py +578 -0
  15. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/config.py +86 -51
  16. dgcv-0.2.3/src/DGCV/coordinateMaps.py +328 -0
  17. dgcv-0.2.3/src/DGCV/finiteDimAlgebras.py +1932 -0
  18. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/polynomials.py +132 -51
  19. dgcv-0.2.3/src/DGCV/styles.py +1309 -0
  20. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/vectorFieldsAndDifferentialForms.py +730 -435
  21. dgcv-0.2.3/src/DGCV.egg-info/PKG-INFO +46 -0
  22. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV.egg-info/SOURCES.txt +2 -2
  23. dgcv-0.2.2/PKG-INFO +0 -79
  24. dgcv-0.2.2/README.md +0 -65
  25. dgcv-0.2.2/src/DGCV/DGCVFormatter.py +0 -215
  26. dgcv-0.2.2/src/DGCV/RiemannianGeometry.py +0 -853
  27. dgcv-0.2.2/src/DGCV/complexStructures.py +0 -413
  28. dgcv-0.2.2/src/DGCV/coordinateMaps.py +0 -209
  29. dgcv-0.2.2/src/DGCV/finiteDimAlgebras.py +0 -86
  30. dgcv-0.2.2/src/DGCV/styles.py +0 -695
  31. dgcv-0.2.2/src/DGCV.egg-info/PKG-INFO +0 -79
  32. {dgcv-0.2.2 → dgcv-0.2.3}/LICENSE.txt +0 -0
  33. {dgcv-0.2.2 → dgcv-0.2.3}/MANIFEST.in +0 -0
  34. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/__init__.py +0 -0
  35. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Black.ttf +0 -0
  36. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Black.woff2 +0 -0
  37. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Bold.ttf +0 -0
  38. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Bold.woff2 +0 -0
  39. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-ExtraBold.ttf +0 -0
  40. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-ExtraBold.woff2 +0 -0
  41. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Medium.ttf +0 -0
  42. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Medium.woff2 +0 -0
  43. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Regular.ttf +0 -0
  44. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-Regular.woff2 +0 -0
  45. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-SemiBold.ttf +0 -0
  46. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/Orbitron-SemiBold.woff2 +0 -0
  47. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/PatrickHand-Regular.ttf +0 -0
  48. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/fonts/fonts.css +0 -0
  49. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/__init__.py +0 -0
  50. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/populator.ipynb +0 -0
  51. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/precomputed_2x2.py +0 -0
  52. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/precomputed_3x3.py +0 -0
  53. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/precomputed_4x4.py +0 -0
  54. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/precomputed_5x5.py +0 -0
  55. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/precomputed_6x6.py +0 -0
  56. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV/assets/inversions/precomputed_7x7.py +0 -0
  57. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV.egg-info/dependency_links.txt +0 -0
  58. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV.egg-info/requires.txt +0 -0
  59. {dgcv-0.2.2 → dgcv-0.2.3}/src/DGCV.egg-info/top_level.txt +0 -0
dgcv-0.2.3/PKG-INFO ADDED
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.1
2
+ Name: DGCV
3
+ Version: 0.2.3
4
+ Summary: Differential Geometry with Complex Variables
5
+ Author: David Sykes
6
+ Author-email: David Sykes <david@realandimaginary.com>
7
+ License: MIT
8
+ Requires-Python: >=3.6
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE.txt
11
+ Requires-Dist: sympy>=1.9
12
+ Requires-Dist: pandas>=1.0
13
+ Requires-Dist: ipython>=7.0
14
+
15
+ DGCV is an open-source Python package for differential geometry with complex variables. It provides symbolic representations of standard DG objects like vector fields and differential forms in complex coordinate systems. DGCV tracks natural relationships between complex geometric objects constructed from complex variables. This uniform integration allows smooth switching between real and holomorphic coordinate representations. DGCV classes dynamically manage format switching, so complex variables formulas work without conversion. For example, expressions like $\frac{\partial}{\partial x_j}|z_j|^2$ or $d z_j \wedge d \overline{z_j} \left( \frac{\partial}{\partial z_j}, \frac{\partial}{\partial y_j} \right)$ are parsed correctly. Retrieving complex structure-related attributes, like the holomorphic part of a vector field or pluriharmonic terms from a polynomial, is straightforward. Complexified cotangent bundles and their exterior algebras can be decomposed into components from the Dolbeault complex and Dolbeault operators applied to functions and k-forms in either coordinate format.
16
+
17
+ DGCV, developed with Python 3.12, integrates SymPy objects within its data structures and subclasses from SymPy.Basic, inheriting much of SymPy’s functionality. It supports symbolic representations of vector fields, differential forms, and tensor fields. DGCV objects dynamically manage coordinate transformations between real and holomorphic coordinates during computation. It also has dedicated classes for representing common differential geometric structures like Riemannian metrics and Kahler structures. Custom LaTeX rendering provides a clean visual representation of mathematical objects, ideal for sharing ideas in Jupyter notebooks.
18
+
19
+ Install DGCV directly from PyPI with pip:
20
+ ```bash
21
+ pip install DGCV
22
+ ```
23
+
24
+ Note that on macOS/Linux, use `python3` before `pip`, while on Windows, use `py`.
25
+
26
+ For more information, visit the DGCV documentation.
27
+
28
+ Two Jupyter Notebook tutorials are available to help with DGCV:
29
+
30
+ - **DGCV Introduction:** An introduction to key concepts and setup. [View Tutorial](https://www.realandimaginary.com/dgcv/tutorials/DGCV_introduction/)
31
+ - **DGCV in Action:** A quick tour through examples from the library’s functions. [View Tutorial](https://www.realandimaginary.com/dgcv/tutorials/DGCV_in_action/)
32
+
33
+ To run the tutorials locally, clone the DGCV GitHub repository and navigate to the tutorials folder. Use Jupyter to open the corresponding notebooks. Alternatively, download the tutorials from the repository.
34
+
35
+ DGCV documentation is hosted at [https://www.realandimaginary.com/dgcv/](https://www.realandimaginary.com/dgcv/), with documentation for each library function. Full documentation is under development, so refer to the docstrings for more information.
36
+
37
+ DGCV is licensed under the MIT License. See the `LICENSE.txt` file for details.
38
+
39
+ David Sykes created and maintains DGCV.
40
+ The current (0.x.x) version of DGCV serves as a foundation for future updates. Planned additions include:
41
+
42
+ - Extending complex variable handling and dynamic coordinate-type conversion automations. This aims to fully automate handling of complex variable formats, allowing input with any coordinate type and control over formatting. The current API meets this goal for core classes but not ancillary classes, such as differential forms and general tensor fields.
43
+ - Expanding libraries for specialized areas of differential geometry, including Symplect/Contact Hamiltonian formalism, CR structures, Riemannian and Kahler, Sasakian, etc.
44
+
45
+ Contributions and feedback are welcome.
46
+ Stay tuned for more updates!
dgcv-0.2.3/README.md ADDED
@@ -0,0 +1,32 @@
1
+ DGCV is an open-source Python package for differential geometry with complex variables. It provides symbolic representations of standard DG objects like vector fields and differential forms in complex coordinate systems. DGCV tracks natural relationships between complex geometric objects constructed from complex variables. This uniform integration allows smooth switching between real and holomorphic coordinate representations. DGCV classes dynamically manage format switching, so complex variables formulas work without conversion. For example, expressions like $\frac{\partial}{\partial x_j}|z_j|^2$ or $d z_j \wedge d \overline{z_j} \left( \frac{\partial}{\partial z_j}, \frac{\partial}{\partial y_j} \right)$ are parsed correctly. Retrieving complex structure-related attributes, like the holomorphic part of a vector field or pluriharmonic terms from a polynomial, is straightforward. Complexified cotangent bundles and their exterior algebras can be decomposed into components from the Dolbeault complex and Dolbeault operators applied to functions and k-forms in either coordinate format.
2
+
3
+ DGCV, developed with Python 3.12, integrates SymPy objects within its data structures and subclasses from SymPy.Basic, inheriting much of SymPy’s functionality. It supports symbolic representations of vector fields, differential forms, and tensor fields. DGCV objects dynamically manage coordinate transformations between real and holomorphic coordinates during computation. It also has dedicated classes for representing common differential geometric structures like Riemannian metrics and Kahler structures. Custom LaTeX rendering provides a clean visual representation of mathematical objects, ideal for sharing ideas in Jupyter notebooks.
4
+
5
+ Install DGCV directly from PyPI with pip:
6
+ ```bash
7
+ pip install DGCV
8
+ ```
9
+
10
+ Note that on macOS/Linux, use `python3` before `pip`, while on Windows, use `py`.
11
+
12
+ For more information, visit the DGCV documentation.
13
+
14
+ Two Jupyter Notebook tutorials are available to help with DGCV:
15
+
16
+ - **DGCV Introduction:** An introduction to key concepts and setup. [View Tutorial](https://www.realandimaginary.com/dgcv/tutorials/DGCV_introduction/)
17
+ - **DGCV in Action:** A quick tour through examples from the library’s functions. [View Tutorial](https://www.realandimaginary.com/dgcv/tutorials/DGCV_in_action/)
18
+
19
+ To run the tutorials locally, clone the DGCV GitHub repository and navigate to the tutorials folder. Use Jupyter to open the corresponding notebooks. Alternatively, download the tutorials from the repository.
20
+
21
+ DGCV documentation is hosted at [https://www.realandimaginary.com/dgcv/](https://www.realandimaginary.com/dgcv/), with documentation for each library function. Full documentation is under development, so refer to the docstrings for more information.
22
+
23
+ DGCV is licensed under the MIT License. See the `LICENSE.txt` file for details.
24
+
25
+ David Sykes created and maintains DGCV.
26
+ The current (0.x.x) version of DGCV serves as a foundation for future updates. Planned additions include:
27
+
28
+ - Extending complex variable handling and dynamic coordinate-type conversion automations. This aims to fully automate handling of complex variable formats, allowing input with any coordinate type and control over formatting. The current API meets this goal for core classes but not ancillary classes, such as differential forms and general tensor fields.
29
+ - Expanding libraries for specialized areas of differential geometry, including Symplect/Contact Hamiltonian formalism, CR structures, Riemannian and Kahler, Sasakian, etc.
30
+
31
+ Contributions and feedback are welcome.
32
+ Stay tuned for more updates!
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  requires-python = ">=3.6"
7
7
  name = "DGCV"
8
- version = "0.2.2"
8
+ version = "0.2.3"
9
9
  description = "Differential Geometry with Complex Variables"
10
10
  authors = [{ name = "David Sykes", email = "david@realandimaginary.com" }]
11
11
  license = { text = "MIT" }
@@ -15,3 +15,22 @@ dependencies = [
15
15
  "ipython>=7.0"
16
16
  ]
17
17
  readme = "README.md"
18
+
19
+ [tool.black]
20
+ line-length = 88
21
+ skip-string-normalization = true
22
+ include = '\.pyi?$' # Include both Python (.py) and type hint stub (.pyi) files
23
+ exclude = '''
24
+ /(
25
+ \.git
26
+ | \.hg
27
+ | \.mypy_cache
28
+ | \.tox
29
+ | \.venv
30
+ | _build
31
+ | buck-out
32
+ | build
33
+ | dist
34
+ )/
35
+ '''
36
+ target-version = ["py36"] # Use Python 3.6+ compatible syntax
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = DGCV
3
- version = 0.2.2
3
+ version = 0.2.3
4
4
  description = A package for Differential Geometry with Complex Variables
5
5
  author = David Sykes
6
6
  author_email = david@realandimaginary.com
@@ -15,20 +15,16 @@ To get started, check out the Jupyter Notebook tutorials:
15
15
 
16
16
  setup(
17
17
  name="DGCV",
18
- version="0.2.2",
18
+ version="0.2.3",
19
19
  description="Differential Geometry with Complex Variables",
20
20
  long_description=long_description, # This shows up on PyPI
21
- long_description_content_type='text/markdown',
21
+ long_description_content_type="text/markdown",
22
22
  package_dir={"": "src"}, # This tells setuptools that packages are under src/
23
23
  packages=find_packages(where="src"),
24
24
  package_data={
25
- 'DGCV': ['assets/fonts/*.ttf', 'assets/fonts/fonts.css'], # Include font files
25
+ "DGCV": ["assets/fonts/*.ttf", "assets/fonts/fonts.css"], # Include font files
26
26
  },
27
27
  include_package_data=True,
28
- python_requires='>=3.6',
29
- install_requires=[
30
- 'sympy>=1.9',
31
- 'pandas>=1.0',
32
- 'ipython>=7.0'
33
- ],
28
+ python_requires=">=3.6",
29
+ install_requires=["sympy>=1.9", "pandas>=1.0", "ipython>=7.0"],
34
30
  )
@@ -23,14 +23,12 @@ License:
23
23
  MIT License
24
24
  """
25
25
 
26
-
27
-
28
26
  ############## dependencies
29
27
  from sympy import eye, expand, Matrix, numer, poly_from_expr, solve, Transpose, Symbol
30
28
  from functools import reduce
31
29
  from .config import _cached_caller_globals
32
30
  from .combinatorics import *
33
- from .classesAndVariables import *
31
+ from .DGCore import *
34
32
  from .vectorFieldsAndDifferentialForms import *
35
33
  from .polynomials import *
36
34
  from ._safeguards import retrieve_passkey
@@ -38,14 +36,15 @@ from ._safeguards import retrieve_passkey
38
36
 
39
37
  ############## CR geometry
40
38
 
41
- def tangencyObstruction(arg1,arg2,arg3,*args):
39
+
40
+ def tangencyObstruction(arg1, arg2, arg3, *args):
42
41
  """
43
42
  Computes the tangency obstruction for a holomorphic vector field with respect to a CR hypersurface.
44
-
45
- This function computes the Lie derivative of the real part of a holomorphic vector field applied
43
+
44
+ This function computes the Lie derivative of the real part of a holomorphic vector field applied
46
45
  to the defining equation of a CR hypersurface and then substitutes the defining equation into the result.
47
46
  The output is zero (up to simplification) if and only if the vector field is a symmetry of the hypersurface.
48
-
47
+
49
48
  Parameters:
50
49
  -----------
51
50
  arg1 : VFClass
@@ -54,34 +53,43 @@ def tangencyObstruction(arg1,arg2,arg3,*args):
54
53
  The defining function of the CR hypersurface, expressed in holomorphic or real variables.
55
54
  arg3 : sympy symbol
56
55
  The real variable whose value is set equal to the defining function to define the hypersurface.
57
-
56
+
58
57
  Returns:
59
58
  --------
60
59
  sympy expression
61
60
  The tangency obstruction.
62
-
61
+
63
62
  Raises:
64
63
  -------
65
64
  TypeError
66
65
  If the first argument is not a VFClass instance with DGCVType='complex'.
67
66
  """
68
- if isinstance(arg1,VFClass):
69
- if arg1.DGCVType == 'standard':
70
- raise TypeError('`tangencyObstruction` requires its first argument `vf` to be VFClass with vf.DGCVType=\'complex\'')
67
+ if isinstance(arg1, VFClass):
68
+ if arg1.DGCVType == "standard":
69
+ raise TypeError(
70
+ "`tangencyObstruction` requires its first argument `vf` to be VFClass with vf.DGCVType='complex'"
71
+ )
71
72
  else:
72
- raise TypeError('`tangencyObstruction` requires its first argument `vf` to be VFClass with vf.DGCVType=\'complex\'')
73
- arg1=allToReal(arg1)
74
- evaluationLoc=allToReal(realPartOfVF(arg1)(holToReal(arg3-arg2))).subs(holToReal(symToReal(arg3)),symToReal(arg2))
73
+ raise TypeError(
74
+ "`tangencyObstruction` requires its first argument `vf` to be VFClass with vf.DGCVType='complex'"
75
+ )
76
+ arg1 = allToReal(arg1)
77
+ evaluationLoc = allToReal(realPartOfVF(arg1)(holToReal(arg3 - arg2))).subs(
78
+ holToReal(symToReal(arg3)), symToReal(arg2)
79
+ )
75
80
  return simplify(symToReal(evaluationLoc))
76
81
 
77
- def weightedHomogeneousVF(arg1,arg2,arg3,arg4,degreeCap=0,_tempVar=None,assumeReal=None):
82
+
83
+ def weightedHomogeneousVF(
84
+ arg1, arg2, arg3, arg4, degreeCap=0, _tempVar=None, assumeReal=None
85
+ ):
78
86
  """
79
87
  Creates a weighted homogeneous vector field in a given coordinate space.
80
-
81
- This function generates a general weighted homogeneous vector field in the space of variables provided
82
- in *arg1*, with weights specified in *arg3*. The polynomial degree of variables with zero weight can
88
+
89
+ This function generates a general weighted homogeneous vector field in the space of variables provided
90
+ in *arg1*, with weights specified in *arg3*. The polynomial degree of variables with zero weight can
83
91
  be bounded by *degreeCap*.
84
-
92
+
85
93
  Parameters:
86
94
  -----------
87
95
  arg1 : tuple or list
@@ -98,28 +106,57 @@ def weightedHomogeneousVF(arg1,arg2,arg3,arg4,degreeCap=0,_tempVar=None,assumeRe
98
106
  Internal key.
99
107
  assumeReal : bool, optional
100
108
  Whether to assume the variables are real (default is False).
101
-
109
+
102
110
  Returns:
103
111
  --------
104
112
  VFClass
105
113
  A weighted homogeneous vector field.
106
-
114
+
107
115
  Raises:
108
116
  -------
109
117
  NA
110
118
  """
111
- pListLoc=[]
119
+ pListLoc = []
112
120
  for j in range(len(arg3)):
113
- pListLoc.append(createPolynomial(arg4+'_'+str(j)+'_',arg2+arg3[j],arg1,degreeCap=degreeCap,weightedHomogeneity=arg3,_tempVar=_tempVar,assumeReal=assumeReal))
114
- return reduce(addVF,[scaleVF(pListLoc[j],eval('D_'+str(arg1[j]),_cached_caller_globals)) for j in range(len(arg1))])
115
- def findWeightedCRSymmetries(arg1,arg2,arg3,arg4,arg5,arg6,degreeCap=0,returnVectorFieldBasis=False,applyNumer=False,simplifyingFactor=None):
121
+ pListLoc.append(
122
+ createPolynomial(
123
+ arg4 + "_" + str(j) + "_",
124
+ arg2 + arg3[j],
125
+ arg1,
126
+ degreeCap=degreeCap,
127
+ weightedHomogeneity=arg3,
128
+ _tempVar=_tempVar,
129
+ assumeReal=assumeReal,
130
+ )
131
+ )
132
+ return reduce(
133
+ addVF,
134
+ [
135
+ scaleVF(pListLoc[j], eval("D_" + str(arg1[j]), _cached_caller_globals))
136
+ for j in range(len(arg1))
137
+ ],
138
+ )
139
+
140
+
141
+ def findWeightedCRSymmetries(
142
+ arg1,
143
+ arg2,
144
+ arg3,
145
+ arg4,
146
+ arg5,
147
+ arg6,
148
+ degreeCap=0,
149
+ returnVectorFieldBasis=False,
150
+ applyNumer=False,
151
+ simplifyingFactor=None,
152
+ ):
116
153
  """
117
154
  ***This function's algorithm will be revised in future updates***
118
155
 
119
156
  Attempts to find all infinitesimal symmetries of a rigid CR hypersurface given by setting one variable *arg5* equal to a defining function *arg1* in the variable space *arg2* with weighted homogeneity *arg3* w.r.t. to non-negative integer weights in *arg4*. Variables in the returned vector field's coefficients are labeled by *arg6*.
120
157
 
121
158
  Only polynomial vector fields are searched for, so if a variable is assigned weight zero, the function cannot search across general symmetries. In such cases, it rather searches all possible symmetries with polynomial degree in the zero-weighted variables up to the specified bound *degreeCap*. If *degreeCap* is not specified, then it defaults to zero.
122
-
159
+
123
160
  The algorithm is most succesful when the function *arg1* must be a polynomial.
124
161
 
125
162
  The function *arg1* should not depend on the variable *arg5* (i.e., the algorithm is not intended for implicit defining equations). If there is such dependence *findWeightedCRSymmetries* may still find some but not all symmetries.
@@ -134,68 +171,106 @@ def findWeightedCRSymmetries(arg1,arg2,arg3,arg4,arg5,arg6,degreeCap=0,returnVec
134
171
  arg6: str
135
172
  degreeCap: (optional keyword) set this keyword argument equal to any positive integer. If not specified, it defaults to zero.
136
173
  applyNumer: (optional keyword) True or False. Set equal to true if defining equation is rational but not polynomial. It can help the internal solvers.
137
-
174
+
138
175
  Returns:
139
176
  coefficient list for a holomorphic vector field containing variables, and any set real value for these variables defines an infinitesimal symmetry. **Note, indeed only real values for the variables define actual symmetries**
140
-
177
+
141
178
  Raises:
142
179
  NA
143
180
  """
181
+
144
182
  def extractRIVar(arg1):
145
- return sum([list(holToReal(j).atoms(Symbol)) for j in arg1],[])
146
- VFLoc=addVF(weightedHomogeneousVF(arg2,arg4,arg3,'ALoc',_tempVar=retrieve_passkey(),degreeCap=degreeCap,assumeReal=True),scaleVF(I,weightedHomogeneousVF(arg2,arg4,arg3,'BLoc',_tempVar=retrieve_passkey(),degreeCap=degreeCap,assumeReal=True)))
147
- tOLoc=tangencyObstruction(VFLoc,arg1,arg5,arg2)
148
- varLoc=tOLoc.atoms(Symbol)
149
- varLoc1={j for j in varLoc}
150
- varComp=set(extractRIVar(arg2))
183
+ return sum([list(holToReal(j).atoms(Symbol)) for j in arg1], [])
184
+
185
+ VFLoc = addVF(
186
+ weightedHomogeneousVF(
187
+ arg2,
188
+ arg4,
189
+ arg3,
190
+ "ALoc",
191
+ _tempVar=retrieve_passkey(),
192
+ degreeCap=degreeCap,
193
+ assumeReal=True,
194
+ ),
195
+ scaleVF(
196
+ I,
197
+ weightedHomogeneousVF(
198
+ arg2,
199
+ arg4,
200
+ arg3,
201
+ "BLoc",
202
+ _tempVar=retrieve_passkey(),
203
+ degreeCap=degreeCap,
204
+ assumeReal=True,
205
+ ),
206
+ ),
207
+ )
208
+ tOLoc = tangencyObstruction(VFLoc, arg1, arg5, arg2)
209
+ varLoc = tOLoc.atoms(Symbol)
210
+ varLoc1 = {j for j in varLoc}
211
+ varComp = set(extractRIVar(arg2))
151
212
  varLoc.difference_update(varComp)
152
213
  varLoc1.difference_update(varLoc)
153
214
  varComp.difference_update(varLoc1)
154
- variableProcedure(arg6,len(varLoc),assumeReal=True)
155
- if applyNumer==True:
156
- if varLoc1==set():
157
- varLoc1=set(arg2)
158
- coefListLoc=poly_from_expr(expand(numer(tOLoc)),*varLoc1)[0].coeffs()
159
- solLoc=solve(coefListLoc,varLoc)
160
- elif simplifyingFactor==None:
161
- if varLoc1==set():
162
- varLoc1=set(arg2)
163
- coefListLoc=poly_from_expr(expand(tOLoc),*varLoc1)[0].coeffs()
164
- solLoc=solve(coefListLoc,varLoc)
215
+ variableProcedure(arg6, len(varLoc), assumeReal=True)
216
+ if applyNumer == True:
217
+ if varLoc1 == set():
218
+ varLoc1 = set(arg2)
219
+ coefListLoc = poly_from_expr(expand(numer(tOLoc)), *varLoc1)[0].coeffs()
220
+ solLoc = solve(coefListLoc, varLoc)
221
+ elif simplifyingFactor == None:
222
+ if varLoc1 == set():
223
+ varLoc1 = set(arg2)
224
+ coefListLoc = poly_from_expr(expand(tOLoc), *varLoc1)[0].coeffs()
225
+ solLoc = solve(coefListLoc, varLoc)
165
226
  else:
166
- if varLoc1==set():
167
- varLoc1=set(arg2)
168
- coefListLoc=poly_from_expr(expand(simplify(symToReal(simplifyingFactor)*tOLoc)),*varLoc1)[0].coeffs()
169
- solLoc=solve(coefListLoc,varLoc)
170
- if solLoc==[]:
171
- clearVar(*listVar(temporary_only=True),report=False)
172
- return 'no solution'
173
- elif type(solLoc)==dict:
174
- VFCLoc=[j.subs(solLoc) for j in holVF_coeffs(VFLoc,arg2)]
175
- subVar=sum(VFCLoc).atoms(Symbol)
227
+ if varLoc1 == set():
228
+ varLoc1 = set(arg2)
229
+ coefListLoc = poly_from_expr(
230
+ expand(simplify(symToReal(simplifyingFactor) * tOLoc)), *varLoc1
231
+ )[0].coeffs()
232
+ solLoc = solve(coefListLoc, varLoc)
233
+ if solLoc == []:
234
+ clearVar(*listVar(temporary_only=True), report=False)
235
+ return "no solution"
236
+ elif type(solLoc) == dict:
237
+ VFCLoc = [j.subs(solLoc) for j in holVF_coeffs(VFLoc, arg2)]
238
+ subVar = sum(VFCLoc).atoms(Symbol)
176
239
  subVar.difference_update(set(arg2))
177
- variableProcedure(arg6,len(subVar),assumeReal=True)
178
- VFCLoc=[j.subs(dict(zip(subVar,eval(arg6,_cached_caller_globals)))) for j in VFCLoc]
179
- clearVar(*listVar(temporary_only=True),report=False)
180
- if returnVectorFieldBasis==True:
181
- VFListLoc=[]
182
- for j in eval(arg6,_cached_caller_globals):
183
- VFCLocTemp=[k.subs(j,1).subs([(l,0) for l in eval(arg6,_cached_caller_globals)]) for k in VFCLoc]
184
- VFListLoc.append(assembleFromHolVFC(VFCLocTemp,arg2))
185
- clearVar(arg6,report=False)
240
+ variableProcedure(arg6, len(subVar), assumeReal=True)
241
+ VFCLoc = [
242
+ j.subs(dict(zip(subVar, eval(arg6, _cached_caller_globals))))
243
+ for j in VFCLoc
244
+ ]
245
+ clearVar(*listVar(temporary_only=True), report=False)
246
+ if returnVectorFieldBasis == True:
247
+ VFListLoc = []
248
+ for j in eval(arg6, _cached_caller_globals):
249
+ VFCLocTemp = [
250
+ k.subs(j, 1).subs(
251
+ [(l, 0) for l in eval(arg6, _cached_caller_globals)]
252
+ )
253
+ for k in VFCLoc
254
+ ]
255
+ VFListLoc.append(assembleFromHolVFC(VFCLocTemp, arg2))
256
+ clearVar(arg6, report=False)
186
257
  return VFListLoc, VFCLoc
187
258
  else:
188
259
  return VFCLoc
189
- else:
190
- VFCLoc=holVF_coeffs(VFLoc,arg2)
191
- subVar=sum(VFCLoc).atoms(Symbol)
260
+ else:
261
+ VFCLoc = holVF_coeffs(VFLoc, arg2)
262
+ subVar = sum(VFCLoc).atoms(Symbol)
192
263
  subVar.difference_update(set(arg2))
193
- variableProcedure(arg6,len(subVar),assumeReal=True)
194
- VFCLoc=[j.subs(dict(zip(subVar,eval(arg6,_cached_caller_globals)))) for j in VFCLoc]
195
- clearVar(*listVar(temporary_only=True),report=False)
196
- return VFCLoc,solLoc
264
+ variableProcedure(arg6, len(subVar), assumeReal=True)
265
+ VFCLoc = [
266
+ j.subs(dict(zip(subVar, eval(arg6, _cached_caller_globals))))
267
+ for j in VFCLoc
268
+ ]
269
+ clearVar(*listVar(temporary_only=True), report=False)
270
+ return VFCLoc, solLoc
271
+
197
272
 
198
- def model2Nondegenerate(arg1,arg2,arg3,arg4, return_matrices = False):
273
+ def model2Nondegenerate(arg1, arg2, arg3, arg4, return_matrices=False):
199
274
  """
200
275
  Builds the defining equation for a 2-nondegnerate model hypersurface using the general formula from the arXiv preprint arXiv:2404.06525.
201
276
 
@@ -204,23 +279,57 @@ def model2Nondegenerate(arg1,arg2,arg3,arg4, return_matrices = False):
204
279
  arg2: s-by-s symmetric matrix valued function of some complex variables whose differential at zero is injective, and whose value at zero is zero.
205
280
  arg3: a length s tuple of complex variables, different from those appearing in *arg2*
206
281
  arg4: a single complex variable, different from those appearing in *arg2* and *arg3*
207
-
282
+
208
283
  Returns:
209
284
  A sympy expression. Setting this expression equal to zero defines the 2-nondegenerate model.
210
-
285
+
211
286
  Raises:
212
287
  NA
213
288
  """
214
- BARSLoc=conjugate(arg2)
215
- zVecLoc=Matrix(arg3)
216
- bzVecLoc=Matrix([conjugate(j) for j in arg3])
217
- sizeLoc=arg1.shape[0]
218
- hFun=(Rational(1,2))*((arg1*(eye(sizeLoc)-(BARSLoc*Transpose(arg1)*arg2*arg1))**(-1))+((eye(sizeLoc)-(arg1*BARSLoc*Transpose(arg1)*arg2))**(-1)*arg1))
219
- sFun=arg1*((eye(sizeLoc)-(BARSLoc*Transpose(arg1)*arg2*arg1))**(-1))*BARSLoc*Transpose(arg1)
220
- bsFun=Transpose(arg1)*((eye(sizeLoc)-(arg2*arg1*BARSLoc*Transpose(arg1)))**(-1))*arg2*arg1
289
+ BARSLoc = conjugate(arg2)
290
+ zVecLoc = Matrix(arg3)
291
+ bzVecLoc = Matrix([conjugate(j) for j in arg3])
292
+ sizeLoc = arg1.shape[0]
293
+ hFun = (Rational(1, 2)) * (
294
+ (arg1 * (eye(sizeLoc) - (BARSLoc * Transpose(arg1) * arg2 * arg1)) ** (-1))
295
+ + ((eye(sizeLoc) - (arg1 * BARSLoc * Transpose(arg1) * arg2)) ** (-1) * arg1)
296
+ )
297
+ sFun = (
298
+ arg1
299
+ * ((eye(sizeLoc) - (BARSLoc * Transpose(arg1) * arg2 * arg1)) ** (-1))
300
+ * BARSLoc
301
+ * Transpose(arg1)
302
+ )
303
+ bsFun = (
304
+ Transpose(arg1)
305
+ * ((eye(sizeLoc) - (arg2 * arg1 * BARSLoc * Transpose(arg1))) ** (-1))
306
+ * arg2
307
+ * arg1
308
+ )
221
309
  if return_matrices == True:
222
- return simplify((Transpose(zVecLoc)*hFun*bzVecLoc+(Rational(1,2))*(Transpose(zVecLoc)*sFun*zVecLoc+Transpose(bzVecLoc)*bsFun*bzVecLoc))[0])-im(arg4),hFun,sFun
310
+ return (
311
+ simplify(
312
+ (
313
+ Transpose(zVecLoc) * hFun * bzVecLoc
314
+ + (Rational(1, 2))
315
+ * (
316
+ Transpose(zVecLoc) * sFun * zVecLoc
317
+ + Transpose(bzVecLoc) * bsFun * bzVecLoc
318
+ )
319
+ )[0]
320
+ )
321
+ - im(arg4),
322
+ hFun,
323
+ sFun,
324
+ )
223
325
  else:
224
- return simplify((Transpose(zVecLoc)*hFun*bzVecLoc+(Rational(1,2))*(Transpose(zVecLoc)*sFun*zVecLoc+Transpose(bzVecLoc)*bsFun*bzVecLoc))[0])-im(arg4)
225
-
226
-
326
+ return simplify(
327
+ (
328
+ Transpose(zVecLoc) * hFun * bzVecLoc
329
+ + (Rational(1, 2))
330
+ * (
331
+ Transpose(zVecLoc) * sFun * zVecLoc
332
+ + Transpose(bzVecLoc) * bsFun * bzVecLoc
333
+ )
334
+ )[0]
335
+ ) - im(arg4)