vacspin 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.
vacspin-0.1.0/LICENSE ADDED
@@ -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.
vacspin-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: vacspin
3
+ Version: 0.1.0
4
+ Summary: Group-IV colour-centre spin-photon interfaces: strained spin Hamiltonians, cyclicity, transition-resolved Purcell budgets and exact single-shot readout statistics
5
+ Author: Tanvir Mahmud Mahim
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/TaN-MM-Org/vacspin
8
+ Project-URL: Issues, https://github.com/TaN-MM-Org/vacspin/issues
9
+ Project-URL: Changelog, https://github.com/TaN-MM-Org/vacspin/blob/main/CHANGELOG.md
10
+ Keywords: quantum,color-center,SnV,SiV,diamond,cavity-QED,Purcell,spin-photon-interface,single-shot-readout
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering :: Physics
16
+ Requires-Python: >=3.9
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: numpy>=1.22
20
+ Provides-Extra: test
21
+ Requires-Dist: pytest>=7; extra == "test"
22
+ Dynamic: license-file
23
+
24
+ # vacspin
25
+
26
+ [![tests](https://github.com/TaN-MM-Org/vacspin/actions/workflows/ci.yml/badge.svg)](https://github.com/TaN-MM-Org/vacspin/actions)
27
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
28
+
29
+ How well can a single trapped spin in diamond talk to light? A
30
+ vacancy colour centre (SiV-, GeV-, SnV-, PbV-) holds one electron
31
+ spin whose optical transitions depend on strain, magnetic field and
32
+ the cavity around it -- and every quantum-network number you care
33
+ about (how many photons before the spin flips, how fast you can read
34
+ it out, how often two nodes entangle) follows from that chain.
35
+ `vacspin` computes the whole chain: the spin Hamiltonian, the optical
36
+ transitions and their cyclicity, the cavity Purcell budget, the exact
37
+ single-shot readout statistics, and the remote-entanglement rate --
38
+ with every physics claim pinned in the test suite to a closed form, a
39
+ published measurement, or two independent code paths.
40
+
41
+ ## Install
42
+
43
+ ```
44
+ pip install vacspin # NumPy only
45
+ ```
46
+
47
+ For development: clone the repository and `pip install -e .[test]`.
48
+
49
+ ## The chain in one example
50
+
51
+ ```python
52
+ import vacspin as vs
53
+
54
+ spin = vs.snv_rosenthal2023() # cited SnV- parameters
55
+ b = vs.field_on_circle(147.0, 0.125) # 125 mT at 147 degrees
56
+ f_q = vs.qubit_frequency(spin, b) # -> 3.64 GHz (measured 3.677)
57
+
58
+ ci = vs.CavityInterface(
59
+ q_loaded=500, v_rel=0.68, eta_wg=0.9996, # your cavity
60
+ budget=vs.snv_emission(), # cited emission budget
61
+ lambda0=2244.0, # measured cyclicity
62
+ omega_q_hz=f_q * 1e9,
63
+ xi_pol=vs.xi_pol_overlap(), xi_pos=0.5,
64
+ t_link=0.99, eta_chip=0.8, eta_det=0.9).require_valid()
65
+
66
+ out = vs.fidelity(ci.eta, ci.lambda_cav, ci.gamma_cav, tau=50e-9, s=2.0)
67
+ print(ci.f_c, ci.eta, out["fidelity"]) # Purcell ~19, eta ~0.65
68
+ ```
69
+
70
+ `require_valid()` is not decoration: the Purcell formulas assume the
71
+ bad-cavity, weak-coupling, spin-selective regime, and the interface
72
+ refuses -- naming the failed condition -- rather than extrapolating
73
+ outside it.
74
+
75
+ ## What is inside
76
+
77
+ - **The spin Hamiltonian** (`h_manifold`, `solve`,
78
+ `qubit_frequency`): the effective Hamiltonian all group-IV centres
79
+ share (spin-orbit + strain + Zeeman; Rosenthal et al., PRX 13,
80
+ 031022 (2023)), in pure NumPy, with the exact frame rotation from
81
+ your lab coordinates, the closed-form zero-field splitting, a
82
+ strain-tuning axis, and the perturbative transverse-field formula
83
+ held against full diagonalisation.
84
+ - **Transitions and cyclicity** (`transition_table`, `cyclicity`,
85
+ `rabi_rate`): all sixteen optical transitions with their strengths
86
+ (which obey an exact sum rule the tests assert), the cyclicity that
87
+ decides how many photons a spin emits before it flips -- including
88
+ its exact divergence when the field is aligned with the symmetry
89
+ axis -- and microwave Rabi rates.
90
+ - **The cavity budget** (`CavityInterface`, `purcell_max`): the
91
+ transition-resolved Purcell factor, the lifetime-reduction factor,
92
+ the fraction of decays that reach your detector through the full
93
+ chain (cavity mode, out-coupling port, link, chip, detector), the
94
+ cavity-boosted cyclicity (the cavity enhances only the
95
+ spin-conserving line; its partner is detuned by the qubit
96
+ frequency), and the coupling rate g with
97
+ F = 4 g^2 / (kappa gamma) holding as an exact identity.
98
+ - **Single-shot readout** (`fidelity`, `required_efficiency`,
99
+ `required_window`): exact counting statistics -- the bright record
100
+ is a Poisson photon stream terminated by the spin flip, evaluated
101
+ in closed form, no numerical quadrature -- with background counts,
102
+ off-resonant scattering of the dark spin, and the dark-state
103
+ switch-on channel, at the optimal integer threshold. The inverse
104
+ tools answer the questions an experiment actually asks (what
105
+ efficiency, how long a window) and refuse when the target is
106
+ unreachable, naming the best achievable value.
107
+ - **Remote entanglement** (`barrett_kok_success`,
108
+ `entanglement_rate`): the two-photon heralding budget, with its
109
+ intrinsic factor 1/2 stated as a ceiling no detector removes.
110
+
111
+ ## Cited parameters
112
+
113
+ No physical number is made up, and none is accepted without a source
114
+ -- the `reference` field of both parameter dataclasses is mandatory.
115
+
116
+ - `snv_rosenthal2023()` + `snv_emission()`: the SnV- device values of
117
+ Rosenthal et al., PRX 13, 031022 (2023) with the Thiering-Gali
118
+ quenching factors, and the emission budget of arXiv:2403.13110 /
119
+ Goerlitz et al. / Lee et al. (arXiv:2511.05740). Validated against
120
+ measurement in the tests with no free parameters: the 902.98 GHz
121
+ splitting, the 3.677 GHz qubit frequency, the cyclicity landscape
122
+ (2244 near alignment, 8.6 at 53 degrees), the MHz Rabi scale.
123
+ - `siv_hepp2014()`: the unstrained SiV- splittings (50 and 260 GHz)
124
+ of Hepp et al., PRL 112, 036405 (2014). Strain and orbital
125
+ quenching are sample-specific and deliberately not shipped; the
126
+ reference string says so.
127
+
128
+ For GeV-, PbV-, or your own sample, populate `SpinParameters` and
129
+ `EmissionBudget` from your measurements or the literature; the
130
+ provenance travels with every prediction.
131
+
132
+ ## How it is checked
133
+
134
+ 46 tests (Python 3.9-3.13, run in CI on every push), every claim
135
+ anchored to an exact result, a published measurement, or two
136
+ independent code paths -- never a stored number. Highlights: exact
137
+ Kramers doublets and the closed-form splitting against full
138
+ diagonalisation; the measured SnV- landscape reproduced with no free
139
+ parameters; the exact aligned-field cyclicity divergence; the dipole
140
+ sum rule (total strength exactly 3 per ground state) as an identity;
141
+ the Purcell relation F = 4 g^2/(kappa gamma) as an exact round trip;
142
+ exact Lorentzian and polarisation-overlap limits; the photon budget
143
+ bounded and monotone; the bright-count distribution hitting its
144
+ Poisson and geometric limits at machine precision (the closed-form
145
+ recurrence makes them exact, not approximate); the measured confocal
146
+ operating point (about 4 detected photons at 0.2% efficiency)
147
+ reproduced; the source study's design point (Purcell factor ~19,
148
+ end-to-end efficiency ~0.65, >98% fidelity at the optimal window,
149
+ a >100x speedup over confocal readout) recovered end to end from its
150
+ stated inputs; and inverse-tool round trips and refusals throughout.
151
+
152
+ ## Honest limits
153
+
154
+ Deliberate scope, designed out with reasons: no photonic device
155
+ design (cavity Q, mode volume and taper transfer are inputs you
156
+ simulate or measure -- the companion study's pipeline shows how);
157
+ the readout model is the two-level bad-cavity treatment, and
158
+ `require_valid()` refuses the strong-coupling regime rather than
159
+ mis-describing it; spin coherence times (T1, T2) are
160
+ sample-dependent measurements, not shipped constants; and the
161
+ switch-on dark channel is treated by a union bound, so the reported
162
+ fidelity is the conservative side of the exact answer.
163
+
164
+ ## Associated study
165
+
166
+ > T. M. Mahim, M. M. Rahman and A. S. M. Mohsin, "Fast single-shot
167
+ > readout of tin-vacancy spins with an overcoupled diamond nanocavity
168
+ > on thin-film lithium niobate" (submitted to Optics Express, 2026);
169
+ > pipeline: https://github.com/Tanvir-Mahmud-Mahim/snv-tfln-cavity-interface
170
+
171
+ This package is the general-purpose engine; the paper repository
172
+ holds the device design (FEM/EME/GME photonics) and reproduces the
173
+ specific study. Formalism: Rosenthal et al., PRX 13, 031022 (2023)
174
+ and arXiv:2403.13110; transition-resolved cavity conventions: Lee et
175
+ al., arXiv:2511.05740; heralding: Barrett and Kok, PRA 71, 060310(R)
176
+ (2005).
177
+
178
+ ## Support and governance
179
+
180
+ Written and maintained by Tanvir Mahmud Mahim (Department of
181
+ Electrical and Electronic Engineering, BRAC University), who reviews
182
+ every change and takes the final decision on scope and releases.
183
+ Design questions are discussed in the open in issues and pull
184
+ requests, and the standing rule of
185
+ [CONTRIBUTING.md](CONTRIBUTING.md) binds the maintainer exactly as it
186
+ binds contributors: a change that touches physics arrives with a
187
+ test, and a constant arrives with its source.
188
+
189
+ Support runs through the
190
+ [issue tracker](https://github.com/TaN-MM-Org/vacspin/issues). Usage
191
+ questions are welcome alongside bug reports; a docstring that left a
192
+ unit or a sign convention unclear is treated as a documentation bug,
193
+ not user error. While the version is below 1.0 the API may still move
194
+ between minor versions; such changes are called out in the release
195
+ notes.
196
+
197
+ ## License
198
+
199
+ Apache-2.0.
@@ -0,0 +1,176 @@
1
+ # vacspin
2
+
3
+ [![tests](https://github.com/TaN-MM-Org/vacspin/actions/workflows/ci.yml/badge.svg)](https://github.com/TaN-MM-Org/vacspin/actions)
4
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
5
+
6
+ How well can a single trapped spin in diamond talk to light? A
7
+ vacancy colour centre (SiV-, GeV-, SnV-, PbV-) holds one electron
8
+ spin whose optical transitions depend on strain, magnetic field and
9
+ the cavity around it -- and every quantum-network number you care
10
+ about (how many photons before the spin flips, how fast you can read
11
+ it out, how often two nodes entangle) follows from that chain.
12
+ `vacspin` computes the whole chain: the spin Hamiltonian, the optical
13
+ transitions and their cyclicity, the cavity Purcell budget, the exact
14
+ single-shot readout statistics, and the remote-entanglement rate --
15
+ with every physics claim pinned in the test suite to a closed form, a
16
+ published measurement, or two independent code paths.
17
+
18
+ ## Install
19
+
20
+ ```
21
+ pip install vacspin # NumPy only
22
+ ```
23
+
24
+ For development: clone the repository and `pip install -e .[test]`.
25
+
26
+ ## The chain in one example
27
+
28
+ ```python
29
+ import vacspin as vs
30
+
31
+ spin = vs.snv_rosenthal2023() # cited SnV- parameters
32
+ b = vs.field_on_circle(147.0, 0.125) # 125 mT at 147 degrees
33
+ f_q = vs.qubit_frequency(spin, b) # -> 3.64 GHz (measured 3.677)
34
+
35
+ ci = vs.CavityInterface(
36
+ q_loaded=500, v_rel=0.68, eta_wg=0.9996, # your cavity
37
+ budget=vs.snv_emission(), # cited emission budget
38
+ lambda0=2244.0, # measured cyclicity
39
+ omega_q_hz=f_q * 1e9,
40
+ xi_pol=vs.xi_pol_overlap(), xi_pos=0.5,
41
+ t_link=0.99, eta_chip=0.8, eta_det=0.9).require_valid()
42
+
43
+ out = vs.fidelity(ci.eta, ci.lambda_cav, ci.gamma_cav, tau=50e-9, s=2.0)
44
+ print(ci.f_c, ci.eta, out["fidelity"]) # Purcell ~19, eta ~0.65
45
+ ```
46
+
47
+ `require_valid()` is not decoration: the Purcell formulas assume the
48
+ bad-cavity, weak-coupling, spin-selective regime, and the interface
49
+ refuses -- naming the failed condition -- rather than extrapolating
50
+ outside it.
51
+
52
+ ## What is inside
53
+
54
+ - **The spin Hamiltonian** (`h_manifold`, `solve`,
55
+ `qubit_frequency`): the effective Hamiltonian all group-IV centres
56
+ share (spin-orbit + strain + Zeeman; Rosenthal et al., PRX 13,
57
+ 031022 (2023)), in pure NumPy, with the exact frame rotation from
58
+ your lab coordinates, the closed-form zero-field splitting, a
59
+ strain-tuning axis, and the perturbative transverse-field formula
60
+ held against full diagonalisation.
61
+ - **Transitions and cyclicity** (`transition_table`, `cyclicity`,
62
+ `rabi_rate`): all sixteen optical transitions with their strengths
63
+ (which obey an exact sum rule the tests assert), the cyclicity that
64
+ decides how many photons a spin emits before it flips -- including
65
+ its exact divergence when the field is aligned with the symmetry
66
+ axis -- and microwave Rabi rates.
67
+ - **The cavity budget** (`CavityInterface`, `purcell_max`): the
68
+ transition-resolved Purcell factor, the lifetime-reduction factor,
69
+ the fraction of decays that reach your detector through the full
70
+ chain (cavity mode, out-coupling port, link, chip, detector), the
71
+ cavity-boosted cyclicity (the cavity enhances only the
72
+ spin-conserving line; its partner is detuned by the qubit
73
+ frequency), and the coupling rate g with
74
+ F = 4 g^2 / (kappa gamma) holding as an exact identity.
75
+ - **Single-shot readout** (`fidelity`, `required_efficiency`,
76
+ `required_window`): exact counting statistics -- the bright record
77
+ is a Poisson photon stream terminated by the spin flip, evaluated
78
+ in closed form, no numerical quadrature -- with background counts,
79
+ off-resonant scattering of the dark spin, and the dark-state
80
+ switch-on channel, at the optimal integer threshold. The inverse
81
+ tools answer the questions an experiment actually asks (what
82
+ efficiency, how long a window) and refuse when the target is
83
+ unreachable, naming the best achievable value.
84
+ - **Remote entanglement** (`barrett_kok_success`,
85
+ `entanglement_rate`): the two-photon heralding budget, with its
86
+ intrinsic factor 1/2 stated as a ceiling no detector removes.
87
+
88
+ ## Cited parameters
89
+
90
+ No physical number is made up, and none is accepted without a source
91
+ -- the `reference` field of both parameter dataclasses is mandatory.
92
+
93
+ - `snv_rosenthal2023()` + `snv_emission()`: the SnV- device values of
94
+ Rosenthal et al., PRX 13, 031022 (2023) with the Thiering-Gali
95
+ quenching factors, and the emission budget of arXiv:2403.13110 /
96
+ Goerlitz et al. / Lee et al. (arXiv:2511.05740). Validated against
97
+ measurement in the tests with no free parameters: the 902.98 GHz
98
+ splitting, the 3.677 GHz qubit frequency, the cyclicity landscape
99
+ (2244 near alignment, 8.6 at 53 degrees), the MHz Rabi scale.
100
+ - `siv_hepp2014()`: the unstrained SiV- splittings (50 and 260 GHz)
101
+ of Hepp et al., PRL 112, 036405 (2014). Strain and orbital
102
+ quenching are sample-specific and deliberately not shipped; the
103
+ reference string says so.
104
+
105
+ For GeV-, PbV-, or your own sample, populate `SpinParameters` and
106
+ `EmissionBudget` from your measurements or the literature; the
107
+ provenance travels with every prediction.
108
+
109
+ ## How it is checked
110
+
111
+ 46 tests (Python 3.9-3.13, run in CI on every push), every claim
112
+ anchored to an exact result, a published measurement, or two
113
+ independent code paths -- never a stored number. Highlights: exact
114
+ Kramers doublets and the closed-form splitting against full
115
+ diagonalisation; the measured SnV- landscape reproduced with no free
116
+ parameters; the exact aligned-field cyclicity divergence; the dipole
117
+ sum rule (total strength exactly 3 per ground state) as an identity;
118
+ the Purcell relation F = 4 g^2/(kappa gamma) as an exact round trip;
119
+ exact Lorentzian and polarisation-overlap limits; the photon budget
120
+ bounded and monotone; the bright-count distribution hitting its
121
+ Poisson and geometric limits at machine precision (the closed-form
122
+ recurrence makes them exact, not approximate); the measured confocal
123
+ operating point (about 4 detected photons at 0.2% efficiency)
124
+ reproduced; the source study's design point (Purcell factor ~19,
125
+ end-to-end efficiency ~0.65, >98% fidelity at the optimal window,
126
+ a >100x speedup over confocal readout) recovered end to end from its
127
+ stated inputs; and inverse-tool round trips and refusals throughout.
128
+
129
+ ## Honest limits
130
+
131
+ Deliberate scope, designed out with reasons: no photonic device
132
+ design (cavity Q, mode volume and taper transfer are inputs you
133
+ simulate or measure -- the companion study's pipeline shows how);
134
+ the readout model is the two-level bad-cavity treatment, and
135
+ `require_valid()` refuses the strong-coupling regime rather than
136
+ mis-describing it; spin coherence times (T1, T2) are
137
+ sample-dependent measurements, not shipped constants; and the
138
+ switch-on dark channel is treated by a union bound, so the reported
139
+ fidelity is the conservative side of the exact answer.
140
+
141
+ ## Associated study
142
+
143
+ > T. M. Mahim, M. M. Rahman and A. S. M. Mohsin, "Fast single-shot
144
+ > readout of tin-vacancy spins with an overcoupled diamond nanocavity
145
+ > on thin-film lithium niobate" (submitted to Optics Express, 2026);
146
+ > pipeline: https://github.com/Tanvir-Mahmud-Mahim/snv-tfln-cavity-interface
147
+
148
+ This package is the general-purpose engine; the paper repository
149
+ holds the device design (FEM/EME/GME photonics) and reproduces the
150
+ specific study. Formalism: Rosenthal et al., PRX 13, 031022 (2023)
151
+ and arXiv:2403.13110; transition-resolved cavity conventions: Lee et
152
+ al., arXiv:2511.05740; heralding: Barrett and Kok, PRA 71, 060310(R)
153
+ (2005).
154
+
155
+ ## Support and governance
156
+
157
+ Written and maintained by Tanvir Mahmud Mahim (Department of
158
+ Electrical and Electronic Engineering, BRAC University), who reviews
159
+ every change and takes the final decision on scope and releases.
160
+ Design questions are discussed in the open in issues and pull
161
+ requests, and the standing rule of
162
+ [CONTRIBUTING.md](CONTRIBUTING.md) binds the maintainer exactly as it
163
+ binds contributors: a change that touches physics arrives with a
164
+ test, and a constant arrives with its source.
165
+
166
+ Support runs through the
167
+ [issue tracker](https://github.com/TaN-MM-Org/vacspin/issues). Usage
168
+ questions are welcome alongside bug reports; a docstring that left a
169
+ unit or a sign convention unclear is treated as a documentation bug,
170
+ not user error. While the version is below 1.0 the API may still move
171
+ between minor versions; such changes are called out in the release
172
+ notes.
173
+
174
+ ## License
175
+
176
+ Apache-2.0.
@@ -0,0 +1,34 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vacspin"
7
+ version = "0.1.0"
8
+ description = "Group-IV colour-centre spin-photon interfaces: strained spin Hamiltonians, cyclicity, transition-resolved Purcell budgets and exact single-shot readout statistics"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {text = "Apache-2.0"}
12
+ authors = [{name = "Tanvir Mahmud Mahim"}]
13
+ keywords = ["quantum", "color-center", "SnV", "SiV", "diamond",
14
+ "cavity-QED", "Purcell", "spin-photon-interface",
15
+ "single-shot-readout"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Science/Research",
19
+ "License :: OSI Approved :: Apache Software License",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: Scientific/Engineering :: Physics",
22
+ ]
23
+ dependencies = ["numpy>=1.22"]
24
+
25
+ [project.optional-dependencies]
26
+ test = ["pytest>=7"]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/TaN-MM-Org/vacspin"
30
+ Issues = "https://github.com/TaN-MM-Org/vacspin/issues"
31
+ Changelog = "https://github.com/TaN-MM-Org/vacspin/blob/main/CHANGELOG.md"
32
+
33
+ [tool.setuptools.packages.find]
34
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,47 @@
1
+ """vacspin: group-IV colour-centre spin-photon interfaces, end to end.
2
+
3
+ From the strained spin Hamiltonian of a vacancy centre in diamond
4
+ (SiV-, GeV-, SnV-, PbV-), through its optical transitions and
5
+ cyclicity, the transition-resolved Purcell budget of a coupled
6
+ cavity, to exact single-shot readout statistics and remote-
7
+ entanglement rates -- with every physics claim in the test suite
8
+ pinned to a closed form, a measured anchor, or two independent code
9
+ paths.
10
+
11
+ Methodological basis: T. M. Mahim, M. M. Rahman and A. S. M. Mohsin,
12
+ "Fast single-shot readout of tin-vacancy spins with an overcoupled
13
+ diamond nanocavity on thin-film lithium niobate" (submitted to Optics
14
+ Express, 2026), and the effective-Hamiltonian and readout formalism of
15
+ Rosenthal et al., PRX 13, 031022 (2023) and arXiv:2403.13110.
16
+ """
17
+ from .params import (EmissionBudget, SpinParameters, siv_hepp2014,
18
+ snv_emission, snv_rosenthal2023)
19
+ from .hamiltonian import (GAMMA_GHZ_PER_T, h_manifold, lab_to_spin,
20
+ qubit_frequency, qubit_frequency_perpendicular,
21
+ solve, zero_field_splitting)
22
+ from .transitions import (cyclicity, field_on_circle, rabi_rate,
23
+ transition_strength, transition_table)
24
+ from .cavity import (CavityInterface, lorentzian_suppression,
25
+ purcell_max, xi_pol_overlap)
26
+ from .readout import (fidelity, fidelity_threshold1, geometric_pmf,
27
+ poisson_pmf, polarization_rate, readout_counts,
28
+ required_efficiency, required_window)
29
+ from .remote import barrett_kok_success, entanglement_rate
30
+
31
+ __version__ = "0.1.0"
32
+ __all__ = [
33
+ "SpinParameters", "EmissionBudget", "snv_rosenthal2023",
34
+ "snv_emission", "siv_hepp2014",
35
+ "GAMMA_GHZ_PER_T", "h_manifold", "lab_to_spin", "solve",
36
+ "zero_field_splitting", "qubit_frequency",
37
+ "qubit_frequency_perpendicular",
38
+ "transition_strength", "transition_table", "cyclicity", "rabi_rate",
39
+ "field_on_circle",
40
+ "purcell_max", "lorentzian_suppression", "xi_pol_overlap",
41
+ "CavityInterface",
42
+ "polarization_rate", "readout_counts", "fidelity_threshold1",
43
+ "geometric_pmf", "poisson_pmf", "fidelity", "required_efficiency",
44
+ "required_window",
45
+ "barrett_kok_success", "entanglement_rate",
46
+ "__version__",
47
+ ]