DGCV 0.2.2__tar.gz → 0.2.4__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 (58) hide show
  1. {dgcv-0.2.2/src/DGCV.egg-info → dgcv-0.2.4}/PKG-INFO +1 -1
  2. dgcv-0.2.4/pyproject.toml +26 -0
  3. {dgcv-0.2.2 → dgcv-0.2.4}/setup.cfg +1 -1
  4. {dgcv-0.2.2 → dgcv-0.2.4}/setup.py +6 -10
  5. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/CRGeometry.py +228 -93
  6. dgcv-0.2.2/src/DGCV/classesAndVariables.py → dgcv-0.2.4/src/DGCV/DGCVCore.py +4176 -2899
  7. dgcv-0.2.4/src/DGCV/DGCVFormatter.py +307 -0
  8. dgcv-0.2.4/src/DGCV/RiemannianGeometry.py +1181 -0
  9. dgcv-0.2.2/src/DGCV/DGCV_display.py → dgcv-0.2.4/src/DGCV/_DGCV_display.py +65 -46
  10. dgcv-0.2.4/src/DGCV/__init__.py +334 -0
  11. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/_safeguards.py +134 -35
  12. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/populator.ipynb +4 -3
  13. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/combinatorics.py +117 -89
  14. dgcv-0.2.4/src/DGCV/complexStructures.py +591 -0
  15. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/config.py +86 -51
  16. dgcv-0.2.4/src/DGCV/coordinateMaps.py +330 -0
  17. dgcv-0.2.4/src/DGCV/finiteDimAlgebras.py +2078 -0
  18. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/polynomials.py +140 -62
  19. dgcv-0.2.4/src/DGCV/styles.py +1309 -0
  20. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/vectorFieldsAndDifferentialForms.py +724 -443
  21. {dgcv-0.2.2 → dgcv-0.2.4/src/DGCV.egg-info}/PKG-INFO +1 -1
  22. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV.egg-info/SOURCES.txt +2 -2
  23. dgcv-0.2.2/pyproject.toml +0 -17
  24. dgcv-0.2.2/src/DGCV/DGCVFormatter.py +0 -215
  25. dgcv-0.2.2/src/DGCV/RiemannianGeometry.py +0 -853
  26. dgcv-0.2.2/src/DGCV/__init__.py +0 -90
  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 → dgcv-0.2.4}/LICENSE.txt +0 -0
  32. {dgcv-0.2.2 → dgcv-0.2.4}/MANIFEST.in +0 -0
  33. {dgcv-0.2.2 → dgcv-0.2.4}/README.md +0 -0
  34. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/__init__.py +0 -0
  35. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Black.ttf +0 -0
  36. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Black.woff2 +0 -0
  37. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Bold.ttf +0 -0
  38. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Bold.woff2 +0 -0
  39. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-ExtraBold.ttf +0 -0
  40. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-ExtraBold.woff2 +0 -0
  41. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Medium.ttf +0 -0
  42. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Medium.woff2 +0 -0
  43. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Regular.ttf +0 -0
  44. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-Regular.woff2 +0 -0
  45. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-SemiBold.ttf +0 -0
  46. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/Orbitron-SemiBold.woff2 +0 -0
  47. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/PatrickHand-Regular.ttf +0 -0
  48. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/fonts/fonts.css +0 -0
  49. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/__init__.py +0 -0
  50. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/precomputed_2x2.py +0 -0
  51. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/precomputed_3x3.py +0 -0
  52. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/precomputed_4x4.py +0 -0
  53. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/precomputed_5x5.py +0 -0
  54. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/precomputed_6x6.py +0 -0
  55. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV/assets/inversions/precomputed_7x7.py +0 -0
  56. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV.egg-info/dependency_links.txt +0 -0
  57. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV.egg-info/requires.txt +0 -0
  58. {dgcv-0.2.2 → dgcv-0.2.4}/src/DGCV.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DGCV
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Differential Geometry with Complex Variables
5
5
  Author: David Sykes
6
6
  Author-email: David Sykes <david@realandimaginary.com>
@@ -0,0 +1,26 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ requires-python = ">=3.6"
7
+ name = "DGCV"
8
+ version = "0.2.4"
9
+ description = "Differential Geometry with Complex Variables"
10
+ authors = [{ name = "David Sykes", email = "david@realandimaginary.com" }]
11
+ license = { text = "MIT" }
12
+ dependencies = ["sympy>=1.9", "pandas>=1.0", "ipython>=7.0"]
13
+ readme = "README.md"
14
+
15
+ [tool.ruff]
16
+ line-length = 88
17
+ select = ["F", "E", "W", "I"]
18
+ extend-exclude = ["_build", "buck-out", "build", "dist", "tutorials"]
19
+
20
+ [tool.ruff.lint]
21
+ ignore = ["E501", "Q", "W291"]
22
+
23
+ [tool.black]
24
+ line-length = 88
25
+ skip-string-normalization = false
26
+ target-version = ["py37", "py38", "py39", "py310", "py311"]
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = DGCV
3
- version = 0.2.2
3
+ version = 0.2.4
4
4
  description = A package for Differential Geometry with Complex Variables
5
5
  author = David Sykes
6
6
  author_email = david@realandimaginary.com
@@ -1,4 +1,4 @@
1
- from setuptools import setup, find_packages
1
+ from setuptools import find_packages, setup
2
2
 
3
3
  long_description = """
4
4
  # DGCV - Differential Geometry with Complex Variables
@@ -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.4",
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,29 +23,54 @@ License:
23
23
  MIT License
24
24
  """
25
25
 
26
-
27
-
28
26
  ############## dependencies
29
- from sympy import eye, expand, Matrix, numer, poly_from_expr, solve, Transpose, Symbol
30
27
  from functools import reduce
31
- from .config import _cached_caller_globals
32
- from .combinatorics import *
33
- from .classesAndVariables import *
34
- from .vectorFieldsAndDifferentialForms import *
35
- from .polynomials import *
36
- from ._safeguards import retrieve_passkey
37
28
 
29
+ from sympy import (
30
+ I,
31
+ Matrix,
32
+ Rational,
33
+ Symbol,
34
+ Transpose,
35
+ conjugate,
36
+ expand,
37
+ eye,
38
+ im,
39
+ numer,
40
+ poly_from_expr,
41
+ simplify,
42
+ solve,
43
+ )
44
+
45
+ from ._safeguards import retrieve_passkey
46
+ from .config import _cached_caller_globals
47
+ from .DGCVCore import (
48
+ VFClass,
49
+ addVF,
50
+ allToReal,
51
+ clearVar,
52
+ holToReal,
53
+ holVF_coeffs,
54
+ listVar,
55
+ realPartOfVF,
56
+ scaleVF,
57
+ symToReal,
58
+ variableProcedure,
59
+ )
60
+ from .polynomials import createPolynomial
61
+ from .vectorFieldsAndDifferentialForms import assembleFromHolVFC
38
62
 
39
63
  ############## CR geometry
40
64
 
41
- def tangencyObstruction(arg1,arg2,arg3,*args):
65
+
66
+ def tangencyObstruction(arg1, arg2, arg3, *args):
42
67
  """
43
68
  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
69
+
70
+ This function computes the Lie derivative of the real part of a holomorphic vector field applied
46
71
  to the defining equation of a CR hypersurface and then substitutes the defining equation into the result.
47
72
  The output is zero (up to simplification) if and only if the vector field is a symmetry of the hypersurface.
48
-
73
+
49
74
  Parameters:
50
75
  -----------
51
76
  arg1 : VFClass
@@ -54,34 +79,43 @@ def tangencyObstruction(arg1,arg2,arg3,*args):
54
79
  The defining function of the CR hypersurface, expressed in holomorphic or real variables.
55
80
  arg3 : sympy symbol
56
81
  The real variable whose value is set equal to the defining function to define the hypersurface.
57
-
82
+
58
83
  Returns:
59
84
  --------
60
85
  sympy expression
61
86
  The tangency obstruction.
62
-
87
+
63
88
  Raises:
64
89
  -------
65
90
  TypeError
66
91
  If the first argument is not a VFClass instance with DGCVType='complex'.
67
92
  """
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\'')
93
+ if isinstance(arg1, VFClass):
94
+ if arg1.DGCVType == "standard":
95
+ raise TypeError(
96
+ "`tangencyObstruction` requires its first argument `vf` to be VFClass with vf.DGCVType='complex'"
97
+ )
71
98
  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))
99
+ raise TypeError(
100
+ "`tangencyObstruction` requires its first argument `vf` to be VFClass with vf.DGCVType='complex'"
101
+ )
102
+ arg1 = allToReal(arg1)
103
+ evaluationLoc = allToReal(realPartOfVF(arg1)(holToReal(arg3 - arg2))).subs(
104
+ holToReal(symToReal(arg3)), symToReal(arg2)
105
+ )
75
106
  return simplify(symToReal(evaluationLoc))
76
107
 
77
- def weightedHomogeneousVF(arg1,arg2,arg3,arg4,degreeCap=0,_tempVar=None,assumeReal=None):
108
+
109
+ def weightedHomogeneousVF(
110
+ arg1, arg2, arg3, arg4, degreeCap=0, _tempVar=None, assumeReal=None
111
+ ):
78
112
  """
79
113
  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
114
+
115
+ This function generates a general weighted homogeneous vector field in the space of variables provided
116
+ in *arg1*, with weights specified in *arg3*. The polynomial degree of variables with zero weight can
83
117
  be bounded by *degreeCap*.
84
-
118
+
85
119
  Parameters:
86
120
  -----------
87
121
  arg1 : tuple or list
@@ -98,28 +132,57 @@ def weightedHomogeneousVF(arg1,arg2,arg3,arg4,degreeCap=0,_tempVar=None,assumeRe
98
132
  Internal key.
99
133
  assumeReal : bool, optional
100
134
  Whether to assume the variables are real (default is False).
101
-
135
+
102
136
  Returns:
103
137
  --------
104
138
  VFClass
105
139
  A weighted homogeneous vector field.
106
-
140
+
107
141
  Raises:
108
142
  -------
109
143
  NA
110
144
  """
111
- pListLoc=[]
145
+ pListLoc = []
112
146
  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):
147
+ pListLoc.append(
148
+ createPolynomial(
149
+ arg4 + "_" + str(j) + "_",
150
+ arg2 + arg3[j],
151
+ arg1,
152
+ degreeCap=degreeCap,
153
+ weightedHomogeneity=arg3,
154
+ _tempVar=_tempVar,
155
+ assumeReal=assumeReal,
156
+ )
157
+ )
158
+ return reduce(
159
+ addVF,
160
+ [
161
+ scaleVF(pListLoc[j], eval("D_" + str(arg1[j]), _cached_caller_globals))
162
+ for j in range(len(arg1))
163
+ ],
164
+ )
165
+
166
+
167
+ def findWeightedCRSymmetries(
168
+ arg1,
169
+ arg2,
170
+ arg3,
171
+ arg4,
172
+ arg5,
173
+ arg6,
174
+ degreeCap=0,
175
+ returnVectorFieldBasis=False,
176
+ applyNumer=False,
177
+ simplifyingFactor=None,
178
+ ):
116
179
  """
117
180
  ***This function's algorithm will be revised in future updates***
118
181
 
119
182
  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
183
 
121
184
  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
-
185
+
123
186
  The algorithm is most succesful when the function *arg1* must be a polynomial.
124
187
 
125
188
  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 +197,106 @@ def findWeightedCRSymmetries(arg1,arg2,arg3,arg4,arg5,arg6,degreeCap=0,returnVec
134
197
  arg6: str
135
198
  degreeCap: (optional keyword) set this keyword argument equal to any positive integer. If not specified, it defaults to zero.
136
199
  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
-
200
+
138
201
  Returns:
139
202
  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
-
203
+
141
204
  Raises:
142
205
  NA
143
206
  """
207
+
144
208
  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))
209
+ return sum([list(holToReal(j).atoms(Symbol)) for j in arg1], [])
210
+
211
+ VFLoc = addVF(
212
+ weightedHomogeneousVF(
213
+ arg2,
214
+ arg4,
215
+ arg3,
216
+ "ALoc",
217
+ _tempVar=retrieve_passkey(),
218
+ degreeCap=degreeCap,
219
+ assumeReal=True,
220
+ ),
221
+ scaleVF(
222
+ I,
223
+ weightedHomogeneousVF(
224
+ arg2,
225
+ arg4,
226
+ arg3,
227
+ "BLoc",
228
+ _tempVar=retrieve_passkey(),
229
+ degreeCap=degreeCap,
230
+ assumeReal=True,
231
+ ),
232
+ ),
233
+ )
234
+ tOLoc = tangencyObstruction(VFLoc, arg1, arg5, arg2)
235
+ varLoc = tOLoc.atoms(Symbol)
236
+ varLoc1 = {j for j in varLoc}
237
+ varComp = set(extractRIVar(arg2))
151
238
  varLoc.difference_update(varComp)
152
239
  varLoc1.difference_update(varLoc)
153
240
  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)
241
+ variableProcedure(arg6, len(varLoc), assumeReal=True)
242
+ if applyNumer:
243
+ if varLoc1 == set():
244
+ varLoc1 = set(arg2)
245
+ coefListLoc = poly_from_expr(expand(numer(tOLoc)), *varLoc1)[0].coeffs()
246
+ solLoc = solve(coefListLoc, varLoc)
247
+ elif simplifyingFactor is None:
248
+ if varLoc1 == set():
249
+ varLoc1 = set(arg2)
250
+ coefListLoc = poly_from_expr(expand(tOLoc), *varLoc1)[0].coeffs()
251
+ solLoc = solve(coefListLoc, varLoc)
165
252
  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)
253
+ if varLoc1 == set():
254
+ varLoc1 = set(arg2)
255
+ coefListLoc = poly_from_expr(
256
+ expand(simplify(symToReal(simplifyingFactor) * tOLoc)), *varLoc1
257
+ )[0].coeffs()
258
+ solLoc = solve(coefListLoc, varLoc)
259
+ if solLoc == []:
260
+ clearVar(*listVar(temporary_only=True), report=False)
261
+ return "no solution"
262
+ elif type(solLoc) is dict:
263
+ VFCLoc = [j.subs(solLoc) for j in holVF_coeffs(VFLoc, arg2)]
264
+ subVar = sum(VFCLoc).atoms(Symbol)
176
265
  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)
266
+ variableProcedure(arg6, len(subVar), assumeReal=True)
267
+ VFCLoc = [
268
+ j.subs(dict(zip(subVar, eval(arg6, _cached_caller_globals))))
269
+ for j in VFCLoc
270
+ ]
271
+ clearVar(*listVar(temporary_only=True), report=False)
272
+ if returnVectorFieldBasis:
273
+ VFListLoc = []
274
+ for j in eval(arg6, _cached_caller_globals):
275
+ VFCLocTemp = [
276
+ k.subs(j, 1).subs(
277
+ [(ll, 0) for ll in eval(arg6, _cached_caller_globals)]
278
+ )
279
+ for k in VFCLoc
280
+ ]
281
+ VFListLoc.append(assembleFromHolVFC(VFCLocTemp, arg2))
282
+ clearVar(arg6, report=False)
186
283
  return VFListLoc, VFCLoc
187
284
  else:
188
285
  return VFCLoc
189
- else:
190
- VFCLoc=holVF_coeffs(VFLoc,arg2)
191
- subVar=sum(VFCLoc).atoms(Symbol)
286
+ else:
287
+ VFCLoc = holVF_coeffs(VFLoc, arg2)
288
+ subVar = sum(VFCLoc).atoms(Symbol)
192
289
  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
290
+ variableProcedure(arg6, len(subVar), assumeReal=True)
291
+ VFCLoc = [
292
+ j.subs(dict(zip(subVar, eval(arg6, _cached_caller_globals))))
293
+ for j in VFCLoc
294
+ ]
295
+ clearVar(*listVar(temporary_only=True), report=False)
296
+ return VFCLoc, solLoc
197
297
 
198
- def model2Nondegenerate(arg1,arg2,arg3,arg4, return_matrices = False):
298
+
299
+ def model2Nondegenerate(arg1, arg2, arg3, arg4, return_matrices=False):
199
300
  """
200
301
  Builds the defining equation for a 2-nondegnerate model hypersurface using the general formula from the arXiv preprint arXiv:2404.06525.
201
302
 
@@ -204,23 +305,57 @@ def model2Nondegenerate(arg1,arg2,arg3,arg4, return_matrices = False):
204
305
  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
306
  arg3: a length s tuple of complex variables, different from those appearing in *arg2*
206
307
  arg4: a single complex variable, different from those appearing in *arg2* and *arg3*
207
-
308
+
208
309
  Returns:
209
310
  A sympy expression. Setting this expression equal to zero defines the 2-nondegenerate model.
210
-
311
+
211
312
  Raises:
212
313
  NA
213
314
  """
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
221
- 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
315
+ BARSLoc = conjugate(arg2)
316
+ zVecLoc = Matrix(arg3)
317
+ bzVecLoc = Matrix([conjugate(j) for j in arg3])
318
+ sizeLoc = arg1.shape[0]
319
+ hFun = (Rational(1, 2)) * (
320
+ (arg1 * (eye(sizeLoc) - (BARSLoc * Transpose(arg1) * arg2 * arg1)) ** (-1))
321
+ + ((eye(sizeLoc) - (arg1 * BARSLoc * Transpose(arg1) * arg2)) ** (-1) * arg1)
322
+ )
323
+ sFun = (
324
+ arg1
325
+ * ((eye(sizeLoc) - (BARSLoc * Transpose(arg1) * arg2 * arg1)) ** (-1))
326
+ * BARSLoc
327
+ * Transpose(arg1)
328
+ )
329
+ bsFun = (
330
+ Transpose(arg1)
331
+ * ((eye(sizeLoc) - (arg2 * arg1 * BARSLoc * Transpose(arg1))) ** (-1))
332
+ * arg2
333
+ * arg1
334
+ )
335
+ if return_matrices:
336
+ return (
337
+ simplify(
338
+ (
339
+ Transpose(zVecLoc) * hFun * bzVecLoc
340
+ + (Rational(1, 2))
341
+ * (
342
+ Transpose(zVecLoc) * sFun * zVecLoc
343
+ + Transpose(bzVecLoc) * bsFun * bzVecLoc
344
+ )
345
+ )[0]
346
+ )
347
+ - im(arg4),
348
+ hFun,
349
+ sFun,
350
+ )
223
351
  else:
224
- return simplify((Transpose(zVecLoc)*hFun*bzVecLoc+(Rational(1,2))*(Transpose(zVecLoc)*sFun*zVecLoc+Transpose(bzVecLoc)*bsFun*bzVecLoc))[0])-im(arg4)
225
-
226
-
352
+ return simplify(
353
+ (
354
+ Transpose(zVecLoc) * hFun * bzVecLoc
355
+ + (Rational(1, 2))
356
+ * (
357
+ Transpose(zVecLoc) * sFun * zVecLoc
358
+ + Transpose(bzVecLoc) * bsFun * bzVecLoc
359
+ )
360
+ )[0]
361
+ ) - im(arg4)