lyznet 0.1.0__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.
Files changed (101) hide show
  1. lyznet-0.1.0/CHANGELOG.md +32 -0
  2. lyznet-0.1.0/INSTALL.md +56 -0
  3. lyznet-0.1.0/LICENSE +204 -0
  4. lyznet-0.1.0/MANIFEST.in +11 -0
  5. lyznet-0.1.0/PKG-INFO +157 -0
  6. lyznet-0.1.0/README.md +120 -0
  7. lyznet-0.1.0/examples/README.md +25 -0
  8. lyznet-0.1.0/examples/minimal_workflows/homogeneous_lyapunov/README.md +36 -0
  9. lyznet-0.1.0/examples/minimal_workflows/homogeneous_lyapunov/degree_five.py +40 -0
  10. lyznet-0.1.0/examples/minimal_workflows/homogeneous_lyapunov/irrational.py +61 -0
  11. lyznet-0.1.0/examples/minimal_workflows/pinn_lyapunov/README.md +25 -0
  12. lyznet-0.1.0/examples/minimal_workflows/pinn_lyapunov/exact_basin.py +32 -0
  13. lyznet-0.1.0/examples/minimal_workflows/pinn_lyapunov/polynomial_2d.py +25 -0
  14. lyznet-0.1.0/examples/minimal_workflows/pinn_lyapunov/two_machine.py +37 -0
  15. lyznet-0.1.0/examples/minimal_workflows/pinn_lyapunov/vdp_mu_1.py +25 -0
  16. lyznet-0.1.0/examples/minimal_workflows/pinn_lyapunov/vdp_mu_3.py +70 -0
  17. lyznet-0.1.0/examples/minimal_workflows/polynomial_lyapunov/README.md +8 -0
  18. lyznet-0.1.0/examples/minimal_workflows/polynomial_lyapunov/global_z3.py +27 -0
  19. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/README.md +12 -0
  20. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/inverted_pendulum_global.py +22 -0
  21. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/linear_clf_roa_crown.py +30 -0
  22. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/pendulum_lyapunov_roa_dreal.py +29 -0
  23. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/vdp_clf_global.py +29 -0
  24. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/vdp_clf_roa_dreal.py +34 -0
  25. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/vdp_lyapunov_roa_crown.py +33 -0
  26. lyznet-0.1.0/examples/minimal_workflows/quadratic_lyapunov/vdp_lyapunov_roa_z3.py +28 -0
  27. lyznet-0.1.0/examples/reproductions/README.md +98 -0
  28. lyznet-0.1.0/examples/reproductions/automatica_2025/README.md +45 -0
  29. lyznet-0.1.0/examples/reproductions/automatica_2025/_regression.py +56 -0
  30. lyznet-0.1.0/examples/reproductions/automatica_2025/two_machine.py +132 -0
  31. lyznet-0.1.0/examples/reproductions/automatica_2025/vdp_mu_1.py +74 -0
  32. lyznet-0.1.0/examples/reproductions/automatica_2025/vdp_mu_3.py +77 -0
  33. lyznet-0.1.0/pyproject.toml +60 -0
  34. lyznet-0.1.0/setup.cfg +4 -0
  35. lyznet-0.1.0/src/lyznet/__init__.py +108 -0
  36. lyznet-0.1.0/src/lyznet/_symbolic_z3.py +79 -0
  37. lyznet-0.1.0/src/lyznet/analysis.py +443 -0
  38. lyznet-0.1.0/src/lyznet/assessment.py +295 -0
  39. lyznet-0.1.0/src/lyznet/certificates.py +58 -0
  40. lyznet-0.1.0/src/lyznet/constraints.py +58 -0
  41. lyznet-0.1.0/src/lyznet/equilibria.py +196 -0
  42. lyznet-0.1.0/src/lyznet/homogeneous_learning.py +427 -0
  43. lyznet-0.1.0/src/lyznet/homogeneous_workflow.py +121 -0
  44. lyznet-0.1.0/src/lyznet/neural.py +337 -0
  45. lyznet-0.1.0/src/lyznet/neural_assessment.py +281 -0
  46. lyznet-0.1.0/src/lyznet/neural_learning.py +1312 -0
  47. lyznet-0.1.0/src/lyznet/neural_options.py +43 -0
  48. lyznet-0.1.0/src/lyznet/neural_workflow.py +535 -0
  49. lyznet-0.1.0/src/lyznet/plotting.py +290 -0
  50. lyznet-0.1.0/src/lyznet/sets.py +243 -0
  51. lyznet-0.1.0/src/lyznet/synthesis.py +255 -0
  52. lyznet-0.1.0/src/lyznet/systems.py +614 -0
  53. lyznet-0.1.0/src/lyznet/verification/__init__.py +33 -0
  54. lyznet-0.1.0/src/lyznet/verification/_crown.py +423 -0
  55. lyznet-0.1.0/src/lyznet/verification/_level_search.py +38 -0
  56. lyznet-0.1.0/src/lyznet/verification/_quadratic_clf.py +85 -0
  57. lyznet-0.1.0/src/lyznet/verification/control_lyapunov.py +479 -0
  58. lyznet-0.1.0/src/lyznet/verification/core/__init__.py +1 -0
  59. lyznet-0.1.0/src/lyznet/verification/core/global_lyapunov_z3.py +102 -0
  60. lyznet-0.1.0/src/lyznet/verification/core/global_quadratic_dreal.py +22 -0
  61. lyznet-0.1.0/src/lyznet/verification/core/homogeneous_dreal.py +40 -0
  62. lyznet-0.1.0/src/lyznet/verification/core/neural_lyapunov_crown.py +271 -0
  63. lyznet-0.1.0/src/lyznet/verification/core/quadratic_clf_crown.py +44 -0
  64. lyznet-0.1.0/src/lyznet/verification/core/quadratic_clf_dreal.py +54 -0
  65. lyznet-0.1.0/src/lyznet/verification/core/quadratic_clf_z3.py +59 -0
  66. lyznet-0.1.0/src/lyznet/verification/core/quadratic_crown.py +77 -0
  67. lyznet-0.1.0/src/lyznet/verification/core/quadratic_dreal.py +83 -0
  68. lyznet-0.1.0/src/lyznet/verification/core/quadratic_z3.py +44 -0
  69. lyznet-0.1.0/src/lyznet/verification/core/trigonometric_z3.py +50 -0
  70. lyznet-0.1.0/src/lyznet/verification/global_lyapunov.py +297 -0
  71. lyznet-0.1.0/src/lyznet/verification/global_quadratic.py +201 -0
  72. lyznet-0.1.0/src/lyznet/verification/homogeneous_dreal.py +291 -0
  73. lyznet-0.1.0/src/lyznet/verification/neural_crown.py +729 -0
  74. lyznet-0.1.0/src/lyznet/verification/quadratic.py +596 -0
  75. lyznet-0.1.0/src/lyznet/verification/quadratic_clf_crown.py +248 -0
  76. lyznet-0.1.0/src/lyznet/verification/quadratic_clf_dreal.py +264 -0
  77. lyznet-0.1.0/src/lyznet/verification/quadratic_crown.py +307 -0
  78. lyznet-0.1.0/src/lyznet/verification/quadratic_dreal.py +415 -0
  79. lyznet-0.1.0/src/lyznet/workflows.py +367 -0
  80. lyznet-0.1.0/src/lyznet.egg-info/PKG-INFO +157 -0
  81. lyznet-0.1.0/src/lyznet.egg-info/SOURCES.txt +99 -0
  82. lyznet-0.1.0/src/lyznet.egg-info/dependency_links.txt +1 -0
  83. lyznet-0.1.0/src/lyznet.egg-info/requires.txt +21 -0
  84. lyznet-0.1.0/src/lyznet.egg-info/scm_file_list.json +102 -0
  85. lyznet-0.1.0/src/lyznet.egg-info/scm_version.json +8 -0
  86. lyznet-0.1.0/src/lyznet.egg-info/top_level.txt +1 -0
  87. lyznet-0.1.0/tests/test_analysis.py +137 -0
  88. lyznet-0.1.0/tests/test_assessment_plotting.py +70 -0
  89. lyznet-0.1.0/tests/test_control_lyapunov.py +135 -0
  90. lyznet-0.1.0/tests/test_equilibria.py +83 -0
  91. lyznet-0.1.0/tests/test_examples.py +148 -0
  92. lyznet-0.1.0/tests/test_global_lyapunov.py +99 -0
  93. lyznet-0.1.0/tests/test_homogeneous.py +124 -0
  94. lyznet-0.1.0/tests/test_neural_lyapunov.py +524 -0
  95. lyznet-0.1.0/tests/test_package.py +7 -0
  96. lyznet-0.1.0/tests/test_quadratic_crown.py +159 -0
  97. lyznet-0.1.0/tests/test_quadratic_dreal.py +106 -0
  98. lyznet-0.1.0/tests/test_quadratic_verification.py +94 -0
  99. lyznet-0.1.0/tests/test_sets.py +129 -0
  100. lyznet-0.1.0/tests/test_systems.py +238 -0
  101. lyznet-0.1.0/tools/release_smoke.py +17 -0
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ Public development releases increment the middle number (`0.1.0`, `0.2.0`,
4
+ `0.3.0`, and so on). The last number is reserved for corrections to an
5
+ already published release. Before version 1.0, release notes identify every
6
+ incompatible interface change.
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-11-15
11
+
12
+ ### Added
13
+
14
+ - Immutable continuous-time autonomous and control-affine systems, box and
15
+ ball domains, sublevel sets, and numerical equilibrium solving.
16
+ - Quadratic Lyapunov and control-Lyapunov construction from linearization.
17
+ - Bounded and global verification with Z3, dReal, and optional CROWN
18
+ backends.
19
+ - Global polynomial Lyapunov synthesis with independent fixed-candidate
20
+ verification.
21
+ - Plain and quadratic-anchored neural Lyapunov learning from trajectory data
22
+ and the Zubov PDE.
23
+ - Cumulative low, mid, and high neural effort checkpoints with common
24
+ empirical screening and selective formal verification.
25
+ - Empirical screening separated explicitly from formal verification.
26
+ - State constraints and viability-aware neural verification.
27
+ - Global homogeneous neural Lyapunov synthesis and dReal verification on the
28
+ unit sphere.
29
+ - Minimal workflows and exact Automatica 2025 reproduction recipes.
30
+
31
+ [Unreleased]: https://github.com/lyznet/lyznet/compare/v0.1.0...HEAD
32
+ [0.1.0]: https://github.com/lyznet/lyznet/releases/tag/v0.1.0
@@ -0,0 +1,56 @@
1
+ # Installation
2
+
3
+ LyZNet 0.1.0 is tested with Python 3.11 on Linux.
4
+
5
+ ## Base package
6
+
7
+ ```bash
8
+ python -m pip install lyznet
9
+ ```
10
+
11
+ This installs NumPy 1.26 or later, SciPy 1.12 or later, and SymPy 1.12 or
12
+ later.
13
+
14
+ ## Optional Python dependencies
15
+
16
+ Install only the capabilities you need:
17
+
18
+ ```bash
19
+ python -m pip install 'lyznet[z3]'
20
+ python -m pip install 'lyznet[learning,plot]'
21
+ ```
22
+
23
+ The extras install the following packages:
24
+
25
+ | Extra | Requirement |
26
+ | --- | --- |
27
+ | `z3` | `z3-solver>=4.13` |
28
+ | `dreal` | `dreal>=4.21.6.2` Python binding |
29
+ | `learning` or `crown` | `torch>=2.11,<2.12` |
30
+ | `plot` | `matplotlib>=3.8` |
31
+ | `test` | `pytest>=8` |
32
+
33
+ For GPU learning, install the appropriate PyTorch 2.11 build from the
34
+ [PyTorch installation guide](https://pytorch.org/get-started/locally/)
35
+ before installing LyZNet.
36
+
37
+ ## dReal
38
+
39
+ Install dReal and its prerequisites by following the
40
+ [dReal installation guide](https://github.com/dreal/dreal4#how-to-install).
41
+ Then install its Python binding:
42
+
43
+ ```bash
44
+ python -m pip install 'lyznet[dreal]'
45
+ ```
46
+
47
+ ## α,β-CROWN (alpha-beta-CROWN)
48
+
49
+ Install α,β-CROWN 0.7 by following its
50
+ [installation guide](https://github.com/Verified-Intelligence/alpha-beta-CROWN).
51
+ Then install LyZNet's matching Python dependencies. LyZNet exposes the
52
+ verifier through its `crown` backend.
53
+
54
+ ```bash
55
+ python -m pip install 'lyznet[crown,plot]'
56
+ ```
lyznet-0.1.0/LICENSE ADDED
@@ -0,0 +1,204 @@
1
+ Copyright 2024-2026 Jun Liu
2
+
3
+
4
+ Apache License
5
+ Version 2.0, January 2004
6
+ http://www.apache.org/licenses/
7
+
8
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9
+
10
+ 1. Definitions.
11
+
12
+ "License" shall mean the terms and conditions for use, reproduction,
13
+ and distribution as defined by Sections 1 through 9 of this document.
14
+
15
+ "Licensor" shall mean the copyright owner or entity authorized by
16
+ the copyright owner that is granting the License.
17
+
18
+ "Legal Entity" shall mean the union of the acting entity and all
19
+ other entities that control, are controlled by, or are under common
20
+ control with that entity. For the purposes of this definition,
21
+ "control" means (i) the power, direct or indirect, to cause the
22
+ direction or management of such entity, whether by contract or
23
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
24
+ outstanding shares, or (iii) beneficial ownership of such entity.
25
+
26
+ "You" (or "Your") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "Source" form shall mean the preferred form for making modifications,
30
+ including but not limited to software source code, documentation
31
+ source, and configuration files.
32
+
33
+ "Object" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but
35
+ not limited to compiled object code, generated documentation,
36
+ and conversions to other media types.
37
+
38
+ "Work" shall mean the work of authorship, whether in Source or
39
+ Object form, made available under the License, as indicated by a
40
+ copyright notice that is included in or attached to the work
41
+ (an example is provided in the Appendix below).
42
+
43
+ "Derivative Works" shall mean any work, whether in Source or Object
44
+ form, that is based on (or derived from) the Work and for which the
45
+ editorial revisions, annotations, elaborations, or other modifications
46
+ represent, as a whole, an original work of authorship. For the purposes
47
+ of this License, Derivative Works shall not include works that remain
48
+ separable from, or merely link (or bind by name) to the interfaces of,
49
+ the Work and Derivative Works thereof.
50
+
51
+ "Contribution" shall mean any work of authorship, including
52
+ the original version of the Work and any modifications or additions
53
+ to that Work or Derivative Works thereof, that is intentionally
54
+ submitted to Licensor for inclusion in the Work by the copyright owner
55
+ or by an individual or Legal Entity authorized to submit on behalf of
56
+ the copyright owner. For the purposes of this definition, "submitted"
57
+ means any form of electronic, verbal, or written communication sent
58
+ to the Licensor or its representatives, including but not limited to
59
+ communication on electronic mailing lists, source code control systems,
60
+ and issue tracking systems that are managed by, or on behalf of, the
61
+ Licensor for the purpose of discussing and improving the Work, but
62
+ excluding communication that is conspicuously marked or otherwise
63
+ designated in writing by the copyright owner as "Not a Contribution."
64
+
65
+ "Contributor" shall mean Licensor and any individual or Legal Entity
66
+ on behalf of whom a Contribution has been received by Licensor and
67
+ subsequently incorporated within the Work.
68
+
69
+ 2. Grant of Copyright License. Subject to the terms and conditions of
70
+ this License, each Contributor hereby grants to You a perpetual,
71
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
72
+ copyright license to reproduce, prepare Derivative Works of,
73
+ publicly display, publicly perform, sublicense, and distribute the
74
+ Work and such Derivative Works in Source or Object form.
75
+
76
+ 3. Grant of Patent License. Subject to the terms and conditions of
77
+ this License, each Contributor hereby grants to You a perpetual,
78
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79
+ (except as stated in this section) patent license to make, have made,
80
+ use, offer to sell, sell, import, and otherwise transfer the Work,
81
+ where such license applies only to those patent claims licensable
82
+ by such Contributor that are necessarily infringed by their
83
+ Contribution(s) alone or by combination of their Contribution(s)
84
+ with the Work to which such Contribution(s) was submitted. If You
85
+ institute patent litigation against any entity (including a
86
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
87
+ or a Contribution incorporated within the Work constitutes direct
88
+ or contributory patent infringement, then any patent licenses
89
+ granted to You under this License for that Work shall terminate
90
+ as of the date such litigation is filed.
91
+
92
+ 4. Redistribution. You may reproduce and distribute copies of the
93
+ Work or Derivative Works thereof in any medium, with or without
94
+ modifications, and in Source or Object form, provided that You
95
+ meet the following conditions:
96
+
97
+ (a) You must give any other recipients of the Work or
98
+ Derivative Works a copy of this License; and
99
+
100
+ (b) You must cause any modified files to carry prominent notices
101
+ stating that You changed the files; and
102
+
103
+ (c) You must retain, in the Source form of any Derivative Works
104
+ that You distribute, all copyright, patent, trademark, and
105
+ attribution notices from the Source form of the Work,
106
+ excluding those notices that do not pertain to any part of
107
+ the Derivative Works; and
108
+
109
+ (d) If the Work includes a "NOTICE" text file as part of its
110
+ distribution, then any Derivative Works that You distribute must
111
+ include a readable copy of the attribution notices contained
112
+ within such NOTICE file, excluding those notices that do not
113
+ pertain to any part of the Derivative Works, in at least one
114
+ of the following places: within a NOTICE text file distributed
115
+ as part of the Derivative Works; within the Source form or
116
+ documentation, if provided along with the Derivative Works; or,
117
+ within a display generated by the Derivative Works, if and
118
+ wherever such third-party notices normally appear. The contents
119
+ of the NOTICE file are for informational purposes only and
120
+ do not modify the License. You may add Your own attribution
121
+ notices within Derivative Works that You distribute, alongside
122
+ or as an addendum to the NOTICE text from the Work, provided
123
+ that such additional attribution notices cannot be construed
124
+ as modifying the License.
125
+
126
+ You may add Your own copyright statement to Your modifications and
127
+ may provide additional or different license terms and conditions
128
+ for use, reproduction, or distribution of Your modifications, or
129
+ for any such Derivative Works as a whole, provided Your use,
130
+ reproduction, and distribution of the Work otherwise complies with
131
+ the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
134
+ any Contribution intentionally submitted for inclusion in the Work
135
+ by You to the Licensor shall be under the terms and conditions of
136
+ this License, without any additional terms or conditions.
137
+ Notwithstanding the above, nothing herein shall supersede or modify
138
+ the terms of any separate license agreement you may have executed
139
+ with Licensor regarding such Contributions.
140
+
141
+ 6. Trademarks. This License does not grant permission to use the trade
142
+ names, trademarks, service marks, or product names of the Licensor,
143
+ except as required for reasonable and customary use in describing the
144
+ origin of the Work and reproducing the content of the NOTICE file.
145
+
146
+ 7. Disclaimer of Warranty. Unless required by applicable law or
147
+ agreed to in writing, Licensor provides the Work (and each
148
+ Contributor provides its Contributions) on an "AS IS" BASIS,
149
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150
+ implied, including, without limitation, any warranties or conditions
151
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
+ PARTICULAR PURPOSE. You are solely responsible for determining the
153
+ appropriateness of using or redistributing the Work and assume any
154
+ risks associated with Your exercise of permissions under this License.
155
+
156
+ 8. Limitation of Liability. In no event and under no legal theory,
157
+ whether in tort (including negligence), contract, or otherwise,
158
+ unless required by applicable law (such as deliberate and grossly
159
+ negligent acts) or agreed to in writing, shall any Contributor be
160
+ liable to You for damages, including any direct, indirect, special,
161
+ incidental, or consequential damages of any character arising as a
162
+ result of this License or out of the use or inability to use the
163
+ Work (including but not limited to damages for loss of goodwill,
164
+ work stoppage, computer failure or malfunction, or any and all
165
+ other commercial damages or losses), even if such Contributor
166
+ has been advised of the possibility of such damages.
167
+
168
+ 9. Accepting Warranty or Additional Liability. While redistributing
169
+ the Work or Derivative Works thereof, You may choose to offer,
170
+ and charge a fee for, acceptance of support, warranty, indemnity,
171
+ or other liability obligations and/or rights consistent with this
172
+ License. However, in accepting such obligations, You may act only
173
+ on Your own behalf and on Your sole responsibility, not on behalf
174
+ of any other Contributor, and only if You agree to indemnify,
175
+ defend, and hold each Contributor harmless for any liability
176
+ incurred by, or claims asserted against, such Contributor by reason
177
+ of your accepting any such warranty or additional liability.
178
+
179
+ END OF TERMS AND CONDITIONS
180
+
181
+ APPENDIX: How to apply the Apache License to your work.
182
+
183
+ To apply the Apache License to your work, attach the following
184
+ boilerplate notice, with the fields enclosed by brackets "[]"
185
+ replaced with your own identifying information. (Don't include
186
+ the brackets!) The text should be enclosed in the appropriate
187
+ comment syntax for the file format. We also recommend that a
188
+ file or class name and description of purpose be included on the
189
+ same "printed page" as the copyright notice for easier
190
+ identification within third-party archives.
191
+
192
+ Copyright [yyyy] [name of copyright owner]
193
+
194
+ Licensed under the Apache License, Version 2.0 (the "License");
195
+ you may not use this file except in compliance with the License.
196
+ You may obtain a copy of the License at
197
+
198
+ http://www.apache.org/licenses/LICENSE-2.0
199
+
200
+ Unless required by applicable law or agreed to in writing, software
201
+ distributed under the License is distributed on an "AS IS" BASIS,
202
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
+ See the License for the specific language governing permissions and
204
+ limitations under the License.
@@ -0,0 +1,11 @@
1
+ include CHANGELOG.md
2
+ include INSTALL.md
3
+ recursive-include examples *.md *.py
4
+ recursive-include tools *.py
5
+ exclude .gitignore
6
+ exclude AGENTS.md
7
+ exclude CLAUDE.md
8
+ exclude DEVELOPMENT.md
9
+ prune .github
10
+ global-exclude *.py[cod]
11
+ global-exclude __pycache__
lyznet-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: lyznet
3
+ Version: 0.1.0
4
+ Summary: Learning and formal verification of Lyapunov certificates
5
+ Author-email: Jun Liu <23146644+j49liu@users.noreply.github.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/lyznet/lyznet
8
+ Project-URL: Issues, https://github.com/lyznet/lyznet/issues
9
+ Project-URL: Changelog, https://github.com/lyznet/lyznet/blob/main/CHANGELOG.md
10
+ Keywords: control,dynamical systems,formal verification,Lyapunov functions,neural networks
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
18
+ Requires-Python: <3.12,>=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy>=1.26
22
+ Requires-Dist: scipy>=1.12
23
+ Requires-Dist: sympy>=1.12
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest>=8; extra == "test"
26
+ Provides-Extra: z3
27
+ Requires-Dist: z3-solver>=4.13; extra == "z3"
28
+ Provides-Extra: dreal
29
+ Requires-Dist: dreal>=4.21.6.2; extra == "dreal"
30
+ Provides-Extra: learning
31
+ Requires-Dist: torch<2.12,>=2.11; extra == "learning"
32
+ Provides-Extra: crown
33
+ Requires-Dist: torch<2.12,>=2.11; extra == "crown"
34
+ Provides-Extra: plot
35
+ Requires-Dist: matplotlib>=3.8; extra == "plot"
36
+ Dynamic: license-file
37
+
38
+ # LyZNet: Learning and formally verifying Lyapunov functions for nonlinear dynamical systems
39
+
40
+ LyZNet is an open-source Python toolbox for constructing, learning, and
41
+ formally verifying Lyapunov certificates and regions of attraction. It
42
+ combines classical Lyapunov analysis, physics-informed neural networks,
43
+ satisfiability modulo theories (SMT) solvers, and neural network verifiers to
44
+ obtain rigorous stability certificates.
45
+
46
+ ## Installation
47
+
48
+ LyZNet 0.1.0 is tested with Python 3.11 on Linux.
49
+
50
+ ```bash
51
+ python -m pip install lyznet
52
+ ```
53
+
54
+ See the [installation guide](INSTALL.md) for optional dependencies and GPU
55
+ support, including
56
+ [dReal](https://github.com/dreal/dreal4#how-to-install) and
57
+ [α,β-CROWN (alpha-beta-CROWN)](https://github.com/Verified-Intelligence/alpha-beta-CROWN).
58
+
59
+ ## Quick start
60
+
61
+ ```python
62
+ import sympy as sp
63
+ import lyznet as lz
64
+
65
+ x1, x2 = sp.symbols("x1 x2")
66
+ system = lz.System.continuous(
67
+ dynamics=(-x2, x1 - (1 - x1**2) * x2),
68
+ domain=((-2.5, 2.5), (-3.5, 3.5)),
69
+ )
70
+
71
+ lz.find_lyap(system, verify="z3").require_verified()
72
+ ```
73
+
74
+ This constructs the quadratic Lyapunov function
75
+
76
+ ```text
77
+ V(x) = 1.5 x1^2 - x1 x2 + x2^2
78
+ ```
79
+
80
+ and uses Z3 to verify that its sublevel set `V(x) <= 2.3044` is a region of
81
+ attraction within the specified domain.
82
+
83
+ To learn a neural Lyapunov function from trajectory data and the Zubov PDE,
84
+ then verify it with α,β-CROWN through LyZNet's `crown` backend, use the same
85
+ system:
86
+
87
+ ```python
88
+ lz.find_lyap(system, family="neural", verify="crown", plot=True).require_verified()
89
+ ```
90
+
91
+ See [`examples/minimal_workflows`](examples/minimal_workflows) for concise
92
+ workflows and [`examples/reproductions`](examples/reproductions) for published
93
+ results. The previous implementation is preserved in
94
+ [lyznet-legacy](https://github.com/lyznet/lyznet-legacy) [1, 2].
95
+
96
+ ## References
97
+
98
+ If you use LyZNet in your research, please consider citing the relevant
99
+ papers:
100
+
101
+ 1. J. Liu, Y. Meng, M. Fitzsimmons, and R. Zhou, “LyZNet: A
102
+ Lightweight Python Tool for Learning and Verifying Neural Lyapunov
103
+ Functions and Regions of Attraction,” *Proceedings of the 27th ACM
104
+ International Conference on Hybrid Systems: Computation and Control
105
+ (HSCC)*, pp. 1–8, 2024.
106
+ [doi:10.1145/3641513.3650134](https://doi.org/10.1145/3641513.3650134)
107
+ 2. J. Liu, Y. Meng, M. Fitzsimmons, and R. Zhou, “Physics-Informed
108
+ Neural Network Lyapunov Functions: PDE Characterization, Learning, and
109
+ Verification,” *Automatica*, vol. 175, 112193, 2025.
110
+ [doi:10.1016/j.automatica.2025.112193](https://doi.org/10.1016/j.automatica.2025.112193)
111
+ 3. J. Liu, Y. Meng, M. Fitzsimmons, and R. Zhou, “Towards Learning and
112
+ Verifying Maximal Neural Lyapunov Functions,” *2023 62nd IEEE Conference
113
+ on Decision and Control (CDC)*, pp. 8012–8019, 2023.
114
+ [doi:10.1109/CDC49753.2023.10383299](https://doi.org/10.1109/CDC49753.2023.10383299)
115
+
116
+ ```bibtex
117
+ @inproceedings{liu2024lyznet,
118
+ author={Liu, Jun and Meng, Yiming and Fitzsimmons, Maxwell and Zhou, Ruikun},
119
+ title={{LyZNet}: A Lightweight Python Tool for Learning and Verifying
120
+ Neural Lyapunov Functions and Regions of Attraction},
121
+ booktitle={Proceedings of the 27th ACM International Conference on
122
+ Hybrid Systems: Computation and Control},
123
+ pages={1--8},
124
+ year={2024},
125
+ publisher={ACM},
126
+ doi={10.1145/3641513.3650134}
127
+ }
128
+
129
+ @article{liu2025physics,
130
+ author={Liu, Jun and Meng, Yiming and Fitzsimmons, Maxwell and Zhou, Ruikun},
131
+ title={Physics-Informed Neural Network Lyapunov Functions: {PDE}
132
+ Characterization, Learning, and Verification},
133
+ journal={Automatica},
134
+ volume={175},
135
+ pages={112193},
136
+ year={2025},
137
+ doi={10.1016/j.automatica.2025.112193}
138
+ }
139
+
140
+ @inproceedings{liu2023towards,
141
+ author={Liu, Jun and Meng, Yiming and Fitzsimmons, Maxwell and Zhou, Ruikun},
142
+ title={Towards Learning and Verifying Maximal Neural Lyapunov Functions},
143
+ booktitle={2023 62nd IEEE Conference on Decision and Control ({CDC})},
144
+ pages={8012--8019},
145
+ year={2023},
146
+ publisher={IEEE},
147
+ doi={10.1109/CDC49753.2023.10383299}
148
+ }
149
+ ```
150
+
151
+ ## Contact
152
+
153
+ Jun Liu — [j.liu@uwaterloo.ca](mailto:j.liu@uwaterloo.ca)
154
+
155
+ ## License
156
+
157
+ LyZNet is released under the [Apache License 2.0](LICENSE).
lyznet-0.1.0/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # LyZNet: Learning and formally verifying Lyapunov functions for nonlinear dynamical systems
2
+
3
+ LyZNet is an open-source Python toolbox for constructing, learning, and
4
+ formally verifying Lyapunov certificates and regions of attraction. It
5
+ combines classical Lyapunov analysis, physics-informed neural networks,
6
+ satisfiability modulo theories (SMT) solvers, and neural network verifiers to
7
+ obtain rigorous stability certificates.
8
+
9
+ ## Installation
10
+
11
+ LyZNet 0.1.0 is tested with Python 3.11 on Linux.
12
+
13
+ ```bash
14
+ python -m pip install lyznet
15
+ ```
16
+
17
+ See the [installation guide](INSTALL.md) for optional dependencies and GPU
18
+ support, including
19
+ [dReal](https://github.com/dreal/dreal4#how-to-install) and
20
+ [α,β-CROWN (alpha-beta-CROWN)](https://github.com/Verified-Intelligence/alpha-beta-CROWN).
21
+
22
+ ## Quick start
23
+
24
+ ```python
25
+ import sympy as sp
26
+ import lyznet as lz
27
+
28
+ x1, x2 = sp.symbols("x1 x2")
29
+ system = lz.System.continuous(
30
+ dynamics=(-x2, x1 - (1 - x1**2) * x2),
31
+ domain=((-2.5, 2.5), (-3.5, 3.5)),
32
+ )
33
+
34
+ lz.find_lyap(system, verify="z3").require_verified()
35
+ ```
36
+
37
+ This constructs the quadratic Lyapunov function
38
+
39
+ ```text
40
+ V(x) = 1.5 x1^2 - x1 x2 + x2^2
41
+ ```
42
+
43
+ and uses Z3 to verify that its sublevel set `V(x) <= 2.3044` is a region of
44
+ attraction within the specified domain.
45
+
46
+ To learn a neural Lyapunov function from trajectory data and the Zubov PDE,
47
+ then verify it with α,β-CROWN through LyZNet's `crown` backend, use the same
48
+ system:
49
+
50
+ ```python
51
+ lz.find_lyap(system, family="neural", verify="crown", plot=True).require_verified()
52
+ ```
53
+
54
+ See [`examples/minimal_workflows`](examples/minimal_workflows) for concise
55
+ workflows and [`examples/reproductions`](examples/reproductions) for published
56
+ results. The previous implementation is preserved in
57
+ [lyznet-legacy](https://github.com/lyznet/lyznet-legacy) [1, 2].
58
+
59
+ ## References
60
+
61
+ If you use LyZNet in your research, please consider citing the relevant
62
+ papers:
63
+
64
+ 1. J. Liu, Y. Meng, M. Fitzsimmons, and R. Zhou, “LyZNet: A
65
+ Lightweight Python Tool for Learning and Verifying Neural Lyapunov
66
+ Functions and Regions of Attraction,” *Proceedings of the 27th ACM
67
+ International Conference on Hybrid Systems: Computation and Control
68
+ (HSCC)*, pp. 1–8, 2024.
69
+ [doi:10.1145/3641513.3650134](https://doi.org/10.1145/3641513.3650134)
70
+ 2. J. Liu, Y. Meng, M. Fitzsimmons, and R. Zhou, “Physics-Informed
71
+ Neural Network Lyapunov Functions: PDE Characterization, Learning, and
72
+ Verification,” *Automatica*, vol. 175, 112193, 2025.
73
+ [doi:10.1016/j.automatica.2025.112193](https://doi.org/10.1016/j.automatica.2025.112193)
74
+ 3. J. Liu, Y. Meng, M. Fitzsimmons, and R. Zhou, “Towards Learning and
75
+ Verifying Maximal Neural Lyapunov Functions,” *2023 62nd IEEE Conference
76
+ on Decision and Control (CDC)*, pp. 8012–8019, 2023.
77
+ [doi:10.1109/CDC49753.2023.10383299](https://doi.org/10.1109/CDC49753.2023.10383299)
78
+
79
+ ```bibtex
80
+ @inproceedings{liu2024lyznet,
81
+ author={Liu, Jun and Meng, Yiming and Fitzsimmons, Maxwell and Zhou, Ruikun},
82
+ title={{LyZNet}: A Lightweight Python Tool for Learning and Verifying
83
+ Neural Lyapunov Functions and Regions of Attraction},
84
+ booktitle={Proceedings of the 27th ACM International Conference on
85
+ Hybrid Systems: Computation and Control},
86
+ pages={1--8},
87
+ year={2024},
88
+ publisher={ACM},
89
+ doi={10.1145/3641513.3650134}
90
+ }
91
+
92
+ @article{liu2025physics,
93
+ author={Liu, Jun and Meng, Yiming and Fitzsimmons, Maxwell and Zhou, Ruikun},
94
+ title={Physics-Informed Neural Network Lyapunov Functions: {PDE}
95
+ Characterization, Learning, and Verification},
96
+ journal={Automatica},
97
+ volume={175},
98
+ pages={112193},
99
+ year={2025},
100
+ doi={10.1016/j.automatica.2025.112193}
101
+ }
102
+
103
+ @inproceedings{liu2023towards,
104
+ author={Liu, Jun and Meng, Yiming and Fitzsimmons, Maxwell and Zhou, Ruikun},
105
+ title={Towards Learning and Verifying Maximal Neural Lyapunov Functions},
106
+ booktitle={2023 62nd IEEE Conference on Decision and Control ({CDC})},
107
+ pages={8012--8019},
108
+ year={2023},
109
+ publisher={IEEE},
110
+ doi={10.1109/CDC49753.2023.10383299}
111
+ }
112
+ ```
113
+
114
+ ## Contact
115
+
116
+ Jun Liu — [j.liu@uwaterloo.ca](mailto:j.liu@uwaterloo.ca)
117
+
118
+ ## License
119
+
120
+ LyZNet is released under the [Apache License 2.0](LICENSE).
@@ -0,0 +1,25 @@
1
+ # Examples
2
+
3
+ The examples have two purposes:
4
+
5
+ - `minimal_workflows/` demonstrates one public LyZNet workflow at a time
6
+ with ordinary defaults and little configuration.
7
+ - `reproductions/` records the explicit data, training, verification, and
8
+ regression settings used to reproduce published results.
9
+
10
+ Reproduction recipes may be tailored to a published experiment. They keep
11
+ every tailored parameter visible and do not change the package defaults.
12
+ Generated data, model checkpoints, plots, and proof ledgers are written to
13
+ local `results/` directories and are not tracked by Git.
14
+
15
+ The neural examples include both plain and anchored architectures. The
16
+ two-machine and exact-basin scripts fix a reported random seed because neural
17
+ optimization is not deterministic across seeds.
18
+
19
+ ```bash
20
+ .venv-crown/bin/python examples/minimal_workflows/pinn_lyapunov/vdp_mu_1.py
21
+ .venv-crown/bin/python examples/minimal_workflows/pinn_lyapunov/vdp_mu_3.py
22
+ .venv-crown/bin/python examples/minimal_workflows/pinn_lyapunov/polynomial_2d.py
23
+ .venv-crown/bin/python examples/minimal_workflows/pinn_lyapunov/two_machine.py
24
+ .venv-crown/bin/python examples/minimal_workflows/pinn_lyapunov/exact_basin.py
25
+ ```
@@ -0,0 +1,36 @@
1
+ # Global homogeneous Lyapunov examples
2
+
3
+ These workflows reproduce the autonomous examples from:
4
+
5
+ > M. Fitzsimmons and J. Liu, “A Neural Network Approach to Finding Global
6
+ > Lyapunov Functions for Homogeneous Vector Fields,” *IEEE Control Systems
7
+ > Letters*, vol. 8, pp. 670–675, 2024.
8
+ > [doi:10.1109/LCSYS.2024.3402142][paper]
9
+
10
+ [paper]: https://doi.org/10.1109/LCSYS.2024.3402142
11
+
12
+ Both examples use the same deterministic positive architecture,
13
+
14
+ ```text
15
+ V(x) = ||x||^p exp(a^T tanh(W x/||x|| + b)).
16
+ ```
17
+
18
+ The hidden angular features are fixed. Two linear programs select the output
19
+ coefficients: the first maximizes sampled decrease margin, and the second
20
+ minimizes their one-norm while retaining part of that margin. This numerical
21
+ construction is only a candidate search. dReal independently proves
22
+ positivity and strict decrease on the complete unit sphere, which implies the
23
+ global Lyapunov conditions by homogeneity.
24
+
25
+ Run the published degree-five and irrational benchmarks from the repository
26
+ root:
27
+
28
+ ```bash
29
+ .venv-crown/bin/python examples/minimal_workflows/homogeneous_lyapunov/degree_five.py
30
+ .venv-crown/bin/python examples/minimal_workflows/homogeneous_lyapunov/irrational.py
31
+ ```
32
+
33
+ The irrational formula has a removable singularity at the equilibrium. Its
34
+ system definition explicitly assigns the continuous value zero at the origin;
35
+ the verifier separately proves that every denominator and even-root radicand
36
+ is uniformly well defined on the unit sphere.