sagittarius-py 1.0.9__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 (34) hide show
  1. sagittarius_py-1.0.9/LICENSE +202 -0
  2. sagittarius_py-1.0.9/MANIFEST.in +3 -0
  3. sagittarius_py-1.0.9/NOTICE +0 -0
  4. sagittarius_py-1.0.9/PKG-INFO +203 -0
  5. sagittarius_py-1.0.9/README.md +167 -0
  6. sagittarius_py-1.0.9/pyproject.toml +80 -0
  7. sagittarius_py-1.0.9/sagittarius/__init__.py +104 -0
  8. sagittarius_py-1.0.9/sagittarius/ablation.py +182 -0
  9. sagittarius_py-1.0.9/sagittarius/api.py +2304 -0
  10. sagittarius_py-1.0.9/sagittarius/benchmarking.py +163 -0
  11. sagittarius_py-1.0.9/sagittarius/cli.py +90 -0
  12. sagittarius_py-1.0.9/sagittarius/cluster.py +49 -0
  13. sagittarius_py-1.0.9/sagittarius/events.py +185 -0
  14. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/Manifest.toml +1296 -0
  15. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/Project.toml +25 -0
  16. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/src/Sagittarius.jl +24 -0
  17. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/src/cluster.jl +35 -0
  18. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/src/logging.jl +131 -0
  19. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/src/physics.jl +705 -0
  20. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/src/program.jl +143 -0
  21. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/src/solver.jl +417 -0
  22. sagittarius_py-1.0.9/sagittarius/julia/Sagittarius.jl/test/runtests.jl +17 -0
  23. sagittarius_py-1.0.9/sagittarius/juliapkg-cuda.json +14 -0
  24. sagittarius_py-1.0.9/sagittarius/juliapkg.json +33 -0
  25. sagittarius_py-1.0.9/sagittarius/pulse.py +348 -0
  26. sagittarius_py-1.0.9/sagittarius/runtime.py +1149 -0
  27. sagittarius_py-1.0.9/sagittarius/trajectory_contract.py +176 -0
  28. sagittarius_py-1.0.9/sagittarius_py.egg-info/PKG-INFO +203 -0
  29. sagittarius_py-1.0.9/sagittarius_py.egg-info/SOURCES.txt +32 -0
  30. sagittarius_py-1.0.9/sagittarius_py.egg-info/dependency_links.txt +1 -0
  31. sagittarius_py-1.0.9/sagittarius_py.egg-info/entry_points.txt +2 -0
  32. sagittarius_py-1.0.9/sagittarius_py.egg-info/requires.txt +11 -0
  33. sagittarius_py-1.0.9/sagittarius_py.egg-info/top_level.txt +1 -0
  34. sagittarius_py-1.0.9/setup.cfg +4 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ prune tests
2
+ global-exclude *.py[cod]
3
+ global-exclude __pycache__
File without changes
@@ -0,0 +1,203 @@
1
+ Metadata-Version: 2.4
2
+ Name: sagittarius-py
3
+ Version: 1.0.9
4
+ Summary: A neutral-atom quantum emulator with Julia and Python SDKs
5
+ Author: Sagittarius contributors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Documentation, https://github.com/Ouyxw/Sagittarius/tree/main/docs
8
+ Project-URL: Homepage, https://github.com/Ouyxw/Sagittarius
9
+ Project-URL: Issues, https://github.com/Ouyxw/Sagittarius/issues
10
+ Project-URL: Source, https://github.com/Ouyxw/Sagittarius
11
+ Keywords: neutral atoms,rydberg,quantum simulation,julia,scientific computing
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Physics
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: NOTICE
24
+ Requires-Dist: juliacall>=0.9.35
25
+ Requires-Dist: numpy
26
+ Requires-Dist: pandas
27
+ Requires-Dist: matplotlib
28
+ Requires-Dist: networkx
29
+ Requires-Dist: docplex>=2.32.264
30
+ Requires-Dist: pulp>=3.3.0
31
+ Requires-Dist: seaborn>=0.13.2
32
+ Requires-Dist: scipy>=1.13.1
33
+ Requires-Dist: juliapkg>=0.1.24
34
+ Requires-Dist: click
35
+ Dynamic: license-file
36
+
37
+ # Sagittarius
38
+
39
+ Sagittarius is a research SDK for classical simulation of Rydberg neutral-atom analog dynamics. It combines a Julia physics and solver backend with a Python SDK for experiment-oriented pulse studies and algorithm prototypes.
40
+
41
+ The project is under active development. APIs, backend support, and benchmark results may change unless covered by tests and documented artifacts. Sagittarius is a simulation layer, not a calibrated hardware control stack.
42
+
43
+ ## Capabilities
44
+
45
+ - 2D and 3D atom registers, including chains, square lattices, and unit-disk graphs.
46
+ - Full and Rydberg-blockade-reduced Hilbert spaces.
47
+ - Global and local Rabi-frequency and detuning controls.
48
+ - Constant, ramp, piecewise, Gaussian, Blackman, sinc, and sine-squared pulses.
49
+ - Schrodinger, Lindblad, and Monte Carlo wave-function evolution.
50
+ - Per-atom Rydberg populations and parameter sweeps.
51
+ - CPU execution and experimental GPU backends, with CUDA as the primary target.
52
+ - Python and Julia APIs with shared physical semantics.
53
+ - Runtime diagnostics and versioned result serialization.
54
+ - MWIS-oriented register and visualization primitives for unit-disk-graph studies.
55
+
56
+ See the [API guides](docs/README.md#api-guides) and [physics guides](docs/README.md#physics-guides) for the supported public contracts.
57
+
58
+ ## Repository Layout
59
+
60
+ ```text
61
+ Sagittarius/
62
+ |-- Sagittarius.jl/ # Julia backend
63
+ |-- sagittarius_py/ # Python SDK and tests
64
+ |-- docs/ # User, API, and physics documentation
65
+ `-- scripts/ # Repository maintenance tools
66
+ ```
67
+
68
+ Keep long-running experiments in a separate project rather than under this repository.
69
+
70
+ ## Installation
71
+
72
+ Requirements: Git, Julia 1.10.3 or newer, a Python version supported by `sagittarius_py/pyproject.toml`, and optionally `uv`.
73
+
74
+ For contributors and local development, use a complete source checkout followed by Python dependency synchronization and JuliaPkg resolution. Editable/source installs prefer the top-level `Sagittarius.jl/` backend so Julia edits take effect immediately, while released wheels use the embedded backend under `sagittarius/julia/Sagittarius.jl`.
75
+
76
+ ```bash
77
+ git clone <repository_url> Sagittarius
78
+ cd Sagittarius/sagittarius_py
79
+ uv sync
80
+ uv run python -m juliapkg resolve
81
+ ```
82
+
83
+ Without `uv`:
84
+
85
+ ```bash
86
+ cd Sagittarius/sagittarius_py
87
+ python -m pip install -e .
88
+ python -m juliapkg resolve
89
+ ```
90
+
91
+ The `pip install -e .` path is development-only and still depends on the editable source checkout for Python code updates. A production PyPI release is being prepared but is not published yet; do not use an unqualified `pip install sagittarius-py` command until the release record says that the package is available. Once published, the authoritative consumer-install instructions will be in the [Python package installation guide](docs/getting-started/python/package-installation.md).
92
+
93
+ For source installs, backend setup, package-release status, container setup, and environment troubleshooting, see the [installation overview](docs/getting-started/installation.md). Python-specific setup lives under [docs/getting-started/python](docs/getting-started/python/source-installation.md); Julia-native setup lives under [docs/getting-started/julia](docs/getting-started/julia/projects.md).
94
+
95
+ ### Independent Python Projects
96
+
97
+ ```bash
98
+ mkdir -p ~/workspace/my_experiment
99
+ cd ~/workspace/my_experiment
100
+ uv init
101
+ uv add --editable ../Sagittarius/sagittarius_py
102
+ uv run python -m juliapkg resolve
103
+ uv run python scripts/rabi_simulation.py
104
+ ```
105
+
106
+ ### Independent Julia Projects
107
+
108
+ ```bash
109
+ mkdir -p ~/workspace/my_julia_experiment/scripts
110
+ cd ~/workspace/my_julia_experiment
111
+ julia --project=. -e 'using Pkg; Pkg.develop(path="../Sagittarius/Sagittarius.jl"); Pkg.instantiate()'
112
+ julia --project=. scripts/rabi_simulation.jl
113
+ ```
114
+
115
+ Use `--project=.` instead of modifying `JULIA_LOAD_PATH`. The [Julia projects guide](docs/getting-started/julia/projects.md) contains the recommended layout and a Julia example.
116
+
117
+ ## Python Quick Start
118
+
119
+ This example runs a one-atom Rabi oscillation and records the Rydberg population:
120
+
121
+ ```python
122
+ import numpy as np
123
+ from sagittarius import Atom, Register, Simulation, PulseSequence, SolverConfig
124
+
125
+ reg = Register([Atom(0.0, 0.0, 0.0)], C6=0.0)
126
+ sim = Simulation(
127
+ reg,
128
+ PulseSequence(omega=2.0 * np.pi, delta=0.0),
129
+ SolverConfig(reltol=1e-7, abstol=1e-7),
130
+ )
131
+
132
+ psi0 = np.array([1.0, 0.0], dtype=complex)
133
+ result = sim.run(psi0, 0.0, 0.5, observables={"pop_atom_0": 0})
134
+ print(result.to_pandas().tail())
135
+ ```
136
+
137
+ For a reduced basis, set `SolverConfig(blockade_radius=...)` and allocate the initial state using the size returned by `sim.validate()`. See the [Python minimal examples](docs/getting-started/python/minimal-examples.md) for complete full- and reduced-basis workflows.
138
+
139
+ Solver selection is explicit through `SolverConfig(method=...)`. The default is adaptive `Tsit5`; `Vern9` is available for higher-accuracy adaptive checks; fixed-step `RK4` requires `SolverConfig(method="RK4", adaptive=False, dt=...)`. Run manifests record both requested and effective solver settings.
140
+
141
+ ## Julia Quick Start
142
+
143
+ ```julia
144
+ using Sagittarius
145
+
146
+ reg = chain_register(3; spacing=0.5, C6=100.0)
147
+ context = reduced_basis_context(reg; blockade_radius=0.6)
148
+ H = hamiltonian(reg, fill(1.0, 3), zeros(3); basis_context=context)
149
+
150
+ println("Reduced basis size: ", length(context.basis))
151
+ ```
152
+
153
+ See the [Julia native API](docs/api/SPEC-API-003-julia-native-api.md) and [Python/Julia parity contract](docs/api/SPEC-API-002-python-julia-parity.md).
154
+
155
+ ## Physical Units and Indexing
156
+
157
+ Numeric inputs do not carry units. Coordinates, times, angular frequencies, interaction coefficients, and decay rates must use one consistent unit system. See [physical units and parameter selection](docs/physics/SPEC-PHYS-001-units.md) for `blockade_radius`, `C6`, pulse parameters, and open-system rates.
158
+
159
+ Python atom indices are zero-based and follow `Register.atoms` order; Julia indices are one-based. See the [pulse and indexing contract](docs/api/SPEC-API-001-pulse-and-indexing-contract.md).
160
+
161
+ ## GPU and Diagnostics
162
+
163
+ Enable GPU execution through `SolverConfig`:
164
+
165
+ ```python
166
+ cfg = SolverConfig(use_gpu=True, gpu_backend="CUDA")
167
+ ```
168
+
169
+ Backend names include `CUDA`, `AMDGPU`, and `Metal`, but support and test coverage differ. CPU is the stable default, CUDA is experimental, and AMDGPU/Metal remain planned backends.
170
+
171
+ ```python
172
+ from sagittarius import backend_maturity, doctor, version_info
173
+
174
+ print(version_info())
175
+ print(backend_maturity())
176
+ print(doctor(backend="CUDA", initialize_backend=True))
177
+ ```
178
+
179
+ CUDA is the primary containerized development target, but remains experimental. GPU execution still requires compatible host drivers, runtime libraries, and device passthrough.
180
+
181
+ ## Verification
182
+
183
+ ```bash
184
+ cd sagittarius_py
185
+ uv run sagittarius doctor
186
+ uv run python -m pytest tests/
187
+ ```
188
+
189
+ CPU tests do not require CUDA. GPU tests are opt-in and require a working backend. Performance results must record the hardware, solver settings, backend configuration, version metadata, and retained benchmark artifacts.
190
+
191
+ ## Documentation
192
+
193
+ - [Installation overview](docs/getting-started/installation.md)
194
+ - [Python minimal examples](docs/getting-started/python/minimal-examples.md)
195
+ - [Julia minimal examples](docs/getting-started/julia/minimal-examples.md)
196
+ - [Physical units and parameter selection](docs/physics/SPEC-PHYS-001-units.md)
197
+ - [Python/Julia parity contract](docs/api/SPEC-API-002-python-julia-parity.md)
198
+ - [Solver configuration](docs/api/SPEC-API-005-solver-configuration.md)
199
+ - [Noise models](docs/physics/SPEC-PHYS-004-noise-models.md)
200
+
201
+ ## License
202
+
203
+ Sagittarius is distributed under the [Apache License 2.0](LICENSE).
@@ -0,0 +1,167 @@
1
+ # Sagittarius
2
+
3
+ Sagittarius is a research SDK for classical simulation of Rydberg neutral-atom analog dynamics. It combines a Julia physics and solver backend with a Python SDK for experiment-oriented pulse studies and algorithm prototypes.
4
+
5
+ The project is under active development. APIs, backend support, and benchmark results may change unless covered by tests and documented artifacts. Sagittarius is a simulation layer, not a calibrated hardware control stack.
6
+
7
+ ## Capabilities
8
+
9
+ - 2D and 3D atom registers, including chains, square lattices, and unit-disk graphs.
10
+ - Full and Rydberg-blockade-reduced Hilbert spaces.
11
+ - Global and local Rabi-frequency and detuning controls.
12
+ - Constant, ramp, piecewise, Gaussian, Blackman, sinc, and sine-squared pulses.
13
+ - Schrodinger, Lindblad, and Monte Carlo wave-function evolution.
14
+ - Per-atom Rydberg populations and parameter sweeps.
15
+ - CPU execution and experimental GPU backends, with CUDA as the primary target.
16
+ - Python and Julia APIs with shared physical semantics.
17
+ - Runtime diagnostics and versioned result serialization.
18
+ - MWIS-oriented register and visualization primitives for unit-disk-graph studies.
19
+
20
+ See the [API guides](docs/README.md#api-guides) and [physics guides](docs/README.md#physics-guides) for the supported public contracts.
21
+
22
+ ## Repository Layout
23
+
24
+ ```text
25
+ Sagittarius/
26
+ |-- Sagittarius.jl/ # Julia backend
27
+ |-- sagittarius_py/ # Python SDK and tests
28
+ |-- docs/ # User, API, and physics documentation
29
+ `-- scripts/ # Repository maintenance tools
30
+ ```
31
+
32
+ Keep long-running experiments in a separate project rather than under this repository.
33
+
34
+ ## Installation
35
+
36
+ Requirements: Git, Julia 1.10.3 or newer, a Python version supported by `sagittarius_py/pyproject.toml`, and optionally `uv`.
37
+
38
+ For contributors and local development, use a complete source checkout followed by Python dependency synchronization and JuliaPkg resolution. Editable/source installs prefer the top-level `Sagittarius.jl/` backend so Julia edits take effect immediately, while released wheels use the embedded backend under `sagittarius/julia/Sagittarius.jl`.
39
+
40
+ ```bash
41
+ git clone <repository_url> Sagittarius
42
+ cd Sagittarius/sagittarius_py
43
+ uv sync
44
+ uv run python -m juliapkg resolve
45
+ ```
46
+
47
+ Without `uv`:
48
+
49
+ ```bash
50
+ cd Sagittarius/sagittarius_py
51
+ python -m pip install -e .
52
+ python -m juliapkg resolve
53
+ ```
54
+
55
+ The `pip install -e .` path is development-only and still depends on the editable source checkout for Python code updates. A production PyPI release is being prepared but is not published yet; do not use an unqualified `pip install sagittarius-py` command until the release record says that the package is available. Once published, the authoritative consumer-install instructions will be in the [Python package installation guide](docs/getting-started/python/package-installation.md).
56
+
57
+ For source installs, backend setup, package-release status, container setup, and environment troubleshooting, see the [installation overview](docs/getting-started/installation.md). Python-specific setup lives under [docs/getting-started/python](docs/getting-started/python/source-installation.md); Julia-native setup lives under [docs/getting-started/julia](docs/getting-started/julia/projects.md).
58
+
59
+ ### Independent Python Projects
60
+
61
+ ```bash
62
+ mkdir -p ~/workspace/my_experiment
63
+ cd ~/workspace/my_experiment
64
+ uv init
65
+ uv add --editable ../Sagittarius/sagittarius_py
66
+ uv run python -m juliapkg resolve
67
+ uv run python scripts/rabi_simulation.py
68
+ ```
69
+
70
+ ### Independent Julia Projects
71
+
72
+ ```bash
73
+ mkdir -p ~/workspace/my_julia_experiment/scripts
74
+ cd ~/workspace/my_julia_experiment
75
+ julia --project=. -e 'using Pkg; Pkg.develop(path="../Sagittarius/Sagittarius.jl"); Pkg.instantiate()'
76
+ julia --project=. scripts/rabi_simulation.jl
77
+ ```
78
+
79
+ Use `--project=.` instead of modifying `JULIA_LOAD_PATH`. The [Julia projects guide](docs/getting-started/julia/projects.md) contains the recommended layout and a Julia example.
80
+
81
+ ## Python Quick Start
82
+
83
+ This example runs a one-atom Rabi oscillation and records the Rydberg population:
84
+
85
+ ```python
86
+ import numpy as np
87
+ from sagittarius import Atom, Register, Simulation, PulseSequence, SolverConfig
88
+
89
+ reg = Register([Atom(0.0, 0.0, 0.0)], C6=0.0)
90
+ sim = Simulation(
91
+ reg,
92
+ PulseSequence(omega=2.0 * np.pi, delta=0.0),
93
+ SolverConfig(reltol=1e-7, abstol=1e-7),
94
+ )
95
+
96
+ psi0 = np.array([1.0, 0.0], dtype=complex)
97
+ result = sim.run(psi0, 0.0, 0.5, observables={"pop_atom_0": 0})
98
+ print(result.to_pandas().tail())
99
+ ```
100
+
101
+ For a reduced basis, set `SolverConfig(blockade_radius=...)` and allocate the initial state using the size returned by `sim.validate()`. See the [Python minimal examples](docs/getting-started/python/minimal-examples.md) for complete full- and reduced-basis workflows.
102
+
103
+ Solver selection is explicit through `SolverConfig(method=...)`. The default is adaptive `Tsit5`; `Vern9` is available for higher-accuracy adaptive checks; fixed-step `RK4` requires `SolverConfig(method="RK4", adaptive=False, dt=...)`. Run manifests record both requested and effective solver settings.
104
+
105
+ ## Julia Quick Start
106
+
107
+ ```julia
108
+ using Sagittarius
109
+
110
+ reg = chain_register(3; spacing=0.5, C6=100.0)
111
+ context = reduced_basis_context(reg; blockade_radius=0.6)
112
+ H = hamiltonian(reg, fill(1.0, 3), zeros(3); basis_context=context)
113
+
114
+ println("Reduced basis size: ", length(context.basis))
115
+ ```
116
+
117
+ See the [Julia native API](docs/api/SPEC-API-003-julia-native-api.md) and [Python/Julia parity contract](docs/api/SPEC-API-002-python-julia-parity.md).
118
+
119
+ ## Physical Units and Indexing
120
+
121
+ Numeric inputs do not carry units. Coordinates, times, angular frequencies, interaction coefficients, and decay rates must use one consistent unit system. See [physical units and parameter selection](docs/physics/SPEC-PHYS-001-units.md) for `blockade_radius`, `C6`, pulse parameters, and open-system rates.
122
+
123
+ Python atom indices are zero-based and follow `Register.atoms` order; Julia indices are one-based. See the [pulse and indexing contract](docs/api/SPEC-API-001-pulse-and-indexing-contract.md).
124
+
125
+ ## GPU and Diagnostics
126
+
127
+ Enable GPU execution through `SolverConfig`:
128
+
129
+ ```python
130
+ cfg = SolverConfig(use_gpu=True, gpu_backend="CUDA")
131
+ ```
132
+
133
+ Backend names include `CUDA`, `AMDGPU`, and `Metal`, but support and test coverage differ. CPU is the stable default, CUDA is experimental, and AMDGPU/Metal remain planned backends.
134
+
135
+ ```python
136
+ from sagittarius import backend_maturity, doctor, version_info
137
+
138
+ print(version_info())
139
+ print(backend_maturity())
140
+ print(doctor(backend="CUDA", initialize_backend=True))
141
+ ```
142
+
143
+ CUDA is the primary containerized development target, but remains experimental. GPU execution still requires compatible host drivers, runtime libraries, and device passthrough.
144
+
145
+ ## Verification
146
+
147
+ ```bash
148
+ cd sagittarius_py
149
+ uv run sagittarius doctor
150
+ uv run python -m pytest tests/
151
+ ```
152
+
153
+ CPU tests do not require CUDA. GPU tests are opt-in and require a working backend. Performance results must record the hardware, solver settings, backend configuration, version metadata, and retained benchmark artifacts.
154
+
155
+ ## Documentation
156
+
157
+ - [Installation overview](docs/getting-started/installation.md)
158
+ - [Python minimal examples](docs/getting-started/python/minimal-examples.md)
159
+ - [Julia minimal examples](docs/getting-started/julia/minimal-examples.md)
160
+ - [Physical units and parameter selection](docs/physics/SPEC-PHYS-001-units.md)
161
+ - [Python/Julia parity contract](docs/api/SPEC-API-002-python-julia-parity.md)
162
+ - [Solver configuration](docs/api/SPEC-API-005-solver-configuration.md)
163
+ - [Noise models](docs/physics/SPEC-PHYS-004-noise-models.md)
164
+
165
+ ## License
166
+
167
+ Sagittarius is distributed under the [Apache License 2.0](LICENSE).
@@ -0,0 +1,80 @@
1
+ [project]
2
+ name = "sagittarius-py"
3
+ version = "1.0.9"
4
+ description = "A neutral-atom quantum emulator with Julia and Python SDKs"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ license = "Apache-2.0"
8
+ license-files = ["LICENSE", "NOTICE"]
9
+ authors = [
10
+ { name = "Sagittarius contributors" },
11
+ ]
12
+ keywords = [
13
+ "neutral atoms",
14
+ "rydberg",
15
+ "quantum simulation",
16
+ "julia",
17
+ "scientific computing",
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 5 - Production/Stable",
21
+ "Intended Audience :: Science/Research",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Topic :: Scientific/Engineering :: Physics",
28
+ ]
29
+ dependencies = [
30
+ "juliacall>=0.9.35",
31
+ "numpy",
32
+ "pandas",
33
+ "matplotlib",
34
+ "networkx",
35
+ "docplex>=2.32.264",
36
+ "pulp>=3.3.0",
37
+ "seaborn>=0.13.2",
38
+ "scipy>=1.13.1",
39
+ "juliapkg>=0.1.24",
40
+ "click",
41
+ ]
42
+
43
+ [project.urls]
44
+ Documentation = "https://github.com/Ouyxw/Sagittarius/tree/main/docs"
45
+ Homepage = "https://github.com/Ouyxw/Sagittarius"
46
+ Issues = "https://github.com/Ouyxw/Sagittarius/issues"
47
+ Source = "https://github.com/Ouyxw/Sagittarius"
48
+
49
+ [project.scripts]
50
+ sagittarius = "sagittarius.cli:main"
51
+
52
+ [dependency-groups]
53
+ dev = [
54
+ "pytest",
55
+ "tomli; python_version < '3.11'",
56
+ "twine",
57
+ ]
58
+
59
+ [build-system]
60
+ requires = ["setuptools>=61.0"]
61
+ build-backend = "setuptools.build_meta"
62
+
63
+ [tool.setuptools]
64
+ packages = ["sagittarius"]
65
+
66
+ [tool.setuptools.package-data]
67
+ sagittarius = [
68
+ "juliapkg.json",
69
+ "juliapkg-cuda.json",
70
+ "julia/Sagittarius.jl/Project.toml",
71
+ "julia/Sagittarius.jl/Manifest.toml",
72
+ "julia/Sagittarius.jl/test/*.jl",
73
+ "julia/Sagittarius.jl/src/*.jl",
74
+ ]
75
+
76
+ [tool.pytest.ini_options]
77
+ markers = [
78
+ "requires_julia_backend: tests that require a working Julia/PythonCall backend",
79
+ "requires_cuda_backend: tests that require SAGITTARIUS_ENABLE_GPU_TESTS=1 and a working CUDA backend",
80
+ ]