sqzcomb 0.1.1__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.
- sqzcomb-0.1.1/LICENSE +202 -0
- sqzcomb-0.1.1/PKG-INFO +98 -0
- sqzcomb-0.1.1/README.md +74 -0
- sqzcomb-0.1.1/pyproject.toml +33 -0
- sqzcomb-0.1.1/setup.cfg +4 -0
- sqzcomb-0.1.1/src/sqzcomb/__init__.py +22 -0
- sqzcomb-0.1.1/src/sqzcomb/linearize.py +68 -0
- sqzcomb-0.1.1/src/sqzcomb/lle.py +63 -0
- sqzcomb-0.1.1/src/sqzcomb/spectra.py +70 -0
- sqzcomb-0.1.1/src/sqzcomb.egg-info/PKG-INFO +98 -0
- sqzcomb-0.1.1/src/sqzcomb.egg-info/SOURCES.txt +13 -0
- sqzcomb-0.1.1/src/sqzcomb.egg-info/dependency_links.txt +1 -0
- sqzcomb-0.1.1/src/sqzcomb.egg-info/requires.txt +4 -0
- sqzcomb-0.1.1/src/sqzcomb.egg-info/top_level.txt +1 -0
- sqzcomb-0.1.1/tests/test_sqzcomb.py +81 -0
sqzcomb-0.1.1/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.
|
sqzcomb-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqzcomb
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Squeezed light in Kerr microcombs: Lugiato-Lefever steady states, linearized quantum noise, and detected output spectra
|
|
5
|
+
Author-email: "Tanvir M. Mahim" <tanvir.mahim@bracu.ac.bd>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://tanvir-mahmud-mahim.github.io/software/
|
|
8
|
+
Project-URL: Repository, https://github.com/TaN-MM-Org/sqzcomb
|
|
9
|
+
Project-URL: Issues, https://github.com/TaN-MM-Org/sqzcomb/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/TaN-MM-Org/sqzcomb/releases
|
|
11
|
+
Keywords: squeezed light,microcomb,Kerr,Lugiato-Lefever,quantum optics,homodyne
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: numpy>=1.22
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: pytest; extra == "test"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# sqzcomb
|
|
26
|
+
|
|
27
|
+
[](https://doi.org/10.5281/zenodo.22015375) [](https://github.com/TaN-MM-Org/sqzcomb/actions)
|
|
28
|
+
|
|
29
|
+
Squeezed light in Kerr microcombs, computed **end to end**: from the
|
|
30
|
+
classical Lugiato-Lefever steady state, through the linearized quantum
|
|
31
|
+
fluctuations around it, to the **output quadrature-noise spectrum a
|
|
32
|
+
homodyne detector would report**. The package exists because intracavity
|
|
33
|
+
squeezing is not the observable; what leaves the extraction port is, and
|
|
34
|
+
the coupling that maximizes one does not maximize the other.
|
|
35
|
+
|
|
36
|
+
## Status
|
|
37
|
+
|
|
38
|
+
v0.1.0 (alpha). Implemented and tested:
|
|
39
|
+
|
|
40
|
+
- Lugiato-Lefever solver (Strang splitting; the Kerr step and the
|
|
41
|
+
linear-plus-pump step are each exact)
|
|
42
|
+
- homogeneous steady states against the exact cubic
|
|
43
|
+
- linearized fluctuation (Bogoliubov) matrix around an arbitrary steady
|
|
44
|
+
state, with a stability guard that refuses above-threshold states
|
|
45
|
+
- input-output quadrature spectra with an extraction port and intrinsic
|
|
46
|
+
loss; single-mode and joint two-mode quadratures
|
|
47
|
+
|
|
48
|
+
Verified against closed forms in the test-suite: vacuum passes a passive
|
|
49
|
+
cavity unchanged for every coupling and frequency; the degenerate
|
|
50
|
+
parametric oscillator output spectrum is reproduced to 1e-10; and the
|
|
51
|
+
textbook result that detectable squeezing saturates at 3 dB at critical
|
|
52
|
+
coupling, while full extraction breaks that limit, emerges from the
|
|
53
|
+
machinery rather than being asserted.
|
|
54
|
+
|
|
55
|
+
Not yet implemented (the v0.2+ roadmap, in order): the auxiliary-ring
|
|
56
|
+
photonic molecule and its Purcell extraction of below-threshold modes,
|
|
57
|
+
soliton-crystal steady-state continuation, supermode decomposition of the
|
|
58
|
+
multimode covariance, and thermal input noise.
|
|
59
|
+
|
|
60
|
+
## Install and use
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
pip install -e .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import numpy as np
|
|
68
|
+
from sqzcomb import (lle_evolve, fluctuation_matrix,
|
|
69
|
+
output_quadrature_variance, squeezing_db)
|
|
70
|
+
|
|
71
|
+
# steady state at pump F and detuning alpha, anomalous dispersion d2
|
|
72
|
+
psi = lle_evolve(np.full(256, 0.05 + 0j), F=1.2, alpha=0.8,
|
|
73
|
+
dispersion=(-0.02,), t_end=300.0)
|
|
74
|
+
|
|
75
|
+
M, modes = fluctuation_matrix(psi, alpha=0.8, dispersion=(-0.02,))
|
|
76
|
+
i0 = int(np.where(modes == 0)[0][0])
|
|
77
|
+
v = output_quadrature_variance(M, eta=0.5, omega=0.0,
|
|
78
|
+
mode_index=i0, n_modes=modes.size)
|
|
79
|
+
print(squeezing_db(v), "dB relative to vacuum")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Units are the standard normalized LLE units: time in photon lifetimes,
|
|
83
|
+
eta = kappa_ex / kappa, vacuum variance 1/2.
|
|
84
|
+
|
|
85
|
+
## Methodological basis
|
|
86
|
+
|
|
87
|
+
> T. M. Mahim, M. M. Rahman and A. S. M. Mohsin, "Overcoming the 3 dB
|
|
88
|
+
> squeezing extraction limit in silicon carbide microcombs with a
|
|
89
|
+
> photonic molecule" (under review); code for the paper:
|
|
90
|
+
> https://github.com/Tanvir-Mahmud-Mahim/sic-molecule-squeezer
|
|
91
|
+
|
|
92
|
+
This package is the general-purpose engine; the paper repository
|
|
93
|
+
reproduces the specific published study, including the photonic-molecule
|
|
94
|
+
extraction that this package's v0.1 does not yet contain.
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
Apache-2.0
|
sqzcomb-0.1.1/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# sqzcomb
|
|
2
|
+
|
|
3
|
+
[](https://doi.org/10.5281/zenodo.22015375) [](https://github.com/TaN-MM-Org/sqzcomb/actions)
|
|
4
|
+
|
|
5
|
+
Squeezed light in Kerr microcombs, computed **end to end**: from the
|
|
6
|
+
classical Lugiato-Lefever steady state, through the linearized quantum
|
|
7
|
+
fluctuations around it, to the **output quadrature-noise spectrum a
|
|
8
|
+
homodyne detector would report**. The package exists because intracavity
|
|
9
|
+
squeezing is not the observable; what leaves the extraction port is, and
|
|
10
|
+
the coupling that maximizes one does not maximize the other.
|
|
11
|
+
|
|
12
|
+
## Status
|
|
13
|
+
|
|
14
|
+
v0.1.0 (alpha). Implemented and tested:
|
|
15
|
+
|
|
16
|
+
- Lugiato-Lefever solver (Strang splitting; the Kerr step and the
|
|
17
|
+
linear-plus-pump step are each exact)
|
|
18
|
+
- homogeneous steady states against the exact cubic
|
|
19
|
+
- linearized fluctuation (Bogoliubov) matrix around an arbitrary steady
|
|
20
|
+
state, with a stability guard that refuses above-threshold states
|
|
21
|
+
- input-output quadrature spectra with an extraction port and intrinsic
|
|
22
|
+
loss; single-mode and joint two-mode quadratures
|
|
23
|
+
|
|
24
|
+
Verified against closed forms in the test-suite: vacuum passes a passive
|
|
25
|
+
cavity unchanged for every coupling and frequency; the degenerate
|
|
26
|
+
parametric oscillator output spectrum is reproduced to 1e-10; and the
|
|
27
|
+
textbook result that detectable squeezing saturates at 3 dB at critical
|
|
28
|
+
coupling, while full extraction breaks that limit, emerges from the
|
|
29
|
+
machinery rather than being asserted.
|
|
30
|
+
|
|
31
|
+
Not yet implemented (the v0.2+ roadmap, in order): the auxiliary-ring
|
|
32
|
+
photonic molecule and its Purcell extraction of below-threshold modes,
|
|
33
|
+
soliton-crystal steady-state continuation, supermode decomposition of the
|
|
34
|
+
multimode covariance, and thermal input noise.
|
|
35
|
+
|
|
36
|
+
## Install and use
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
pip install -e .
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import numpy as np
|
|
44
|
+
from sqzcomb import (lle_evolve, fluctuation_matrix,
|
|
45
|
+
output_quadrature_variance, squeezing_db)
|
|
46
|
+
|
|
47
|
+
# steady state at pump F and detuning alpha, anomalous dispersion d2
|
|
48
|
+
psi = lle_evolve(np.full(256, 0.05 + 0j), F=1.2, alpha=0.8,
|
|
49
|
+
dispersion=(-0.02,), t_end=300.0)
|
|
50
|
+
|
|
51
|
+
M, modes = fluctuation_matrix(psi, alpha=0.8, dispersion=(-0.02,))
|
|
52
|
+
i0 = int(np.where(modes == 0)[0][0])
|
|
53
|
+
v = output_quadrature_variance(M, eta=0.5, omega=0.0,
|
|
54
|
+
mode_index=i0, n_modes=modes.size)
|
|
55
|
+
print(squeezing_db(v), "dB relative to vacuum")
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Units are the standard normalized LLE units: time in photon lifetimes,
|
|
59
|
+
eta = kappa_ex / kappa, vacuum variance 1/2.
|
|
60
|
+
|
|
61
|
+
## Methodological basis
|
|
62
|
+
|
|
63
|
+
> T. M. Mahim, M. M. Rahman and A. S. M. Mohsin, "Overcoming the 3 dB
|
|
64
|
+
> squeezing extraction limit in silicon carbide microcombs with a
|
|
65
|
+
> photonic molecule" (under review); code for the paper:
|
|
66
|
+
> https://github.com/Tanvir-Mahmud-Mahim/sic-molecule-squeezer
|
|
67
|
+
|
|
68
|
+
This package is the general-purpose engine; the paper repository
|
|
69
|
+
reproduces the specific published study, including the photonic-molecule
|
|
70
|
+
extraction that this package's v0.1 does not yet contain.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
Apache-2.0
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sqzcomb"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Squeezed light in Kerr microcombs: Lugiato-Lefever steady states, linearized quantum noise, and detected output spectra"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "Apache-2.0" }
|
|
11
|
+
authors = [{ name = "Tanvir M. Mahim", email = "tanvir.mahim@bracu.ac.bd" }]
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
keywords = ["squeezed light", "microcomb", "Kerr", "Lugiato-Lefever", "quantum optics", "homodyne"]
|
|
14
|
+
dependencies = ["numpy>=1.22"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"License :: OSI Approved :: Apache Software License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
test = ["pytest"]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://tanvir-mahmud-mahim.github.io/software/"
|
|
28
|
+
Repository = "https://github.com/TaN-MM-Org/sqzcomb"
|
|
29
|
+
Issues = "https://github.com/TaN-MM-Org/sqzcomb/issues"
|
|
30
|
+
Changelog = "https://github.com/TaN-MM-Org/sqzcomb/releases"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.packages.find]
|
|
33
|
+
where = ["src"]
|
sqzcomb-0.1.1/setup.cfg
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""sqzcomb: squeezed light in Kerr microcombs, from steady state to detected noise.
|
|
2
|
+
|
|
3
|
+
Solves the Lugiato-Lefever equation for the classical intracavity field,
|
|
4
|
+
linearizes the quantum fluctuations around that steady state, and computes
|
|
5
|
+
output quadrature-noise spectra through the standard input-output relations,
|
|
6
|
+
so that a resonator design can be judged by the number a homodyne detector
|
|
7
|
+
would actually report.
|
|
8
|
+
|
|
9
|
+
Methodological basis: T. M. Mahim, M. M. Rahman and A. S. M. Mohsin,
|
|
10
|
+
"Overcoming the 3 dB squeezing extraction limit in silicon carbide
|
|
11
|
+
microcombs with a photonic molecule" (under review).
|
|
12
|
+
"""
|
|
13
|
+
from .lle import lle_evolve, homogeneous_steady_states
|
|
14
|
+
from .linearize import fluctuation_matrix, single_mode_parametric
|
|
15
|
+
from .spectra import output_quadrature_variance, squeezing_db
|
|
16
|
+
|
|
17
|
+
__version__ = "0.1.1"
|
|
18
|
+
__all__ = [
|
|
19
|
+
"lle_evolve", "homogeneous_steady_states",
|
|
20
|
+
"fluctuation_matrix", "single_mode_parametric",
|
|
21
|
+
"output_quadrature_variance", "squeezing_db",
|
|
22
|
+
]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Linearized fluctuation dynamics around an LLE steady state.
|
|
2
|
+
|
|
3
|
+
Writing psi = psi_s + delta and keeping first order, the doubled vector
|
|
4
|
+
z = (delta_a(k1..kM), delta_a*(k1..kM)) obeys dz/dt = M z + inputs, with
|
|
5
|
+
|
|
6
|
+
M = [[ A, B ],
|
|
7
|
+
[ conj(B), conj(A) ]]
|
|
8
|
+
|
|
9
|
+
A_{kk'} = [-(1 + i alpha) + i D(k)] delta_{kk'} + 2 i (|psi_s|^2)^(k - k')
|
|
10
|
+
B_{kk'} = i (psi_s^2)^(k + k') (hat = Fourier component)
|
|
11
|
+
|
|
12
|
+
Below threshold every eigenvalue of M has a negative real part; the module
|
|
13
|
+
checks this and refuses to build spectra on an unstable state.
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import numpy as np
|
|
18
|
+
|
|
19
|
+
from .lle import _linear_symbol
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def fluctuation_matrix(psi_s, alpha, dispersion=(0.0,), modes=None):
|
|
23
|
+
"""Doubled-basis drift matrix M around steady state psi_s.
|
|
24
|
+
|
|
25
|
+
modes : iterable of integer mode numbers to keep (default: all grid
|
|
26
|
+
modes). Returns (M, modes_array).
|
|
27
|
+
"""
|
|
28
|
+
psi_s = np.asarray(psi_s, dtype=complex)
|
|
29
|
+
n = psi_s.size
|
|
30
|
+
kgrid = np.fft.fftfreq(n, d=1.0 / n).astype(int)
|
|
31
|
+
if modes is None:
|
|
32
|
+
modes = kgrid.copy()
|
|
33
|
+
modes = np.asarray(list(modes), dtype=int)
|
|
34
|
+
m = modes.size
|
|
35
|
+
|
|
36
|
+
f_abs2 = np.fft.fft(np.abs(psi_s) ** 2) / n # components of |psi_s|^2
|
|
37
|
+
f_sq = np.fft.fft(psi_s ** 2) / n # components of psi_s^2
|
|
38
|
+
comp_abs2 = dict(zip(kgrid, f_abs2))
|
|
39
|
+
comp_sq = dict(zip(kgrid, f_sq))
|
|
40
|
+
|
|
41
|
+
L = _linear_symbol(alpha, dispersion, modes.astype(float))
|
|
42
|
+
A = np.zeros((m, m), dtype=complex)
|
|
43
|
+
B = np.zeros((m, m), dtype=complex)
|
|
44
|
+
for i, ki in enumerate(modes):
|
|
45
|
+
for j, kj in enumerate(modes):
|
|
46
|
+
if i == j:
|
|
47
|
+
A[i, j] += L[i]
|
|
48
|
+
A[i, j] += 2j * comp_abs2.get(ki - kj, 0.0)
|
|
49
|
+
B[i, j] += 1j * comp_sq.get(ki + kj, 0.0)
|
|
50
|
+
M = np.block([[A, B], [np.conj(B), np.conj(A)]])
|
|
51
|
+
return M, modes
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def single_mode_parametric(mu, delta=0.0):
|
|
55
|
+
"""Drift matrix of a single-mode below-threshold parametric process.
|
|
56
|
+
|
|
57
|
+
dz/dt = M z with M = [[-1 + i delta, mu], [conj(mu), -1 - i delta]].
|
|
58
|
+
Threshold at |mu| = 1 (for delta = 0). For real mu > 0 the phi = pi/2
|
|
59
|
+
output quadrature is squeezed and phi = 0 anti-squeezed. Used for
|
|
60
|
+
validation against the closed-form spectra of the degenerate
|
|
61
|
+
parametric oscillator.
|
|
62
|
+
"""
|
|
63
|
+
return np.array([[-1.0 + 1j * delta, mu],
|
|
64
|
+
[np.conj(mu), -1.0 - 1j * delta]], dtype=complex)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def is_stable(M):
|
|
68
|
+
return bool(np.max(np.linalg.eigvals(M).real) < 0.0)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""Lugiato-Lefever solver (normalized units).
|
|
2
|
+
|
|
3
|
+
d psi / dt = -(1 + i alpha) psi + i |psi|^2 psi + i sum_m (d_m/m!) (-i d/dtheta)^m psi + F
|
|
4
|
+
|
|
5
|
+
with time in units of the photon lifetime 2/kappa, alpha the normalized
|
|
6
|
+
detuning, F the normalized pump, and d_m the normalized dispersion
|
|
7
|
+
coefficients (d_2 < 0 anomalous in this sign convention: D(k) = d2/2 k^2 + ...).
|
|
8
|
+
|
|
9
|
+
Integrator: Strang-split step. The Kerr phase step is exact (|psi|^2 is
|
|
10
|
+
invariant under it); the linear-plus-pump step is exact in the Fourier
|
|
11
|
+
domain (first-order linear ODE with constant inhomogeneity).
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import math
|
|
16
|
+
|
|
17
|
+
import numpy as np
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _linear_symbol(alpha, dispersion, k):
|
|
21
|
+
D = np.zeros_like(k, dtype=float)
|
|
22
|
+
for m, dm in enumerate(dispersion, start=2):
|
|
23
|
+
D += dm / math.factorial(m) * k ** m
|
|
24
|
+
return -(1.0 + 1j * alpha) + 1j * D
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def lle_evolve(psi0, F, alpha, dispersion=(0.0,), t_end=50.0, dt=0.01):
|
|
28
|
+
"""Evolve the LLE from psi0 to t_end; returns the final field.
|
|
29
|
+
|
|
30
|
+
psi0 : complex array over theta in [0, 2 pi) (uniform grid).
|
|
31
|
+
F : scalar pump amplitude (homogeneous pump).
|
|
32
|
+
dispersion : (d2, d3, ...) normalized coefficients.
|
|
33
|
+
"""
|
|
34
|
+
psi = np.asarray(psi0, dtype=complex).copy()
|
|
35
|
+
n = psi.size
|
|
36
|
+
k = np.fft.fftfreq(n, d=1.0 / n) # integer mode numbers
|
|
37
|
+
L = _linear_symbol(alpha, dispersion, k)
|
|
38
|
+
eL = np.exp(L * dt)
|
|
39
|
+
Fk = np.zeros(n, dtype=complex)
|
|
40
|
+
Fk[0] = F * n # FFT convention: homogeneous term lives in k = 0
|
|
41
|
+
# exact linear-with-pump propagator: psi_k -> eL psi_k + (eL - 1)/L * Fk
|
|
42
|
+
with np.errstate(divide="ignore", invalid="ignore"):
|
|
43
|
+
pump_prop = np.where(np.abs(L) > 1e-14, (eL - 1.0) / L, dt)
|
|
44
|
+
steps = int(round(t_end / dt))
|
|
45
|
+
for _ in range(steps):
|
|
46
|
+
psi *= np.exp(1j * np.abs(psi) ** 2 * (0.5 * dt)) # half Kerr
|
|
47
|
+
pk = np.fft.fft(psi)
|
|
48
|
+
pk = eL * pk + pump_prop * Fk # exact linear
|
|
49
|
+
psi = np.fft.ifft(pk)
|
|
50
|
+
psi *= np.exp(1j * np.abs(psi) ** 2 * (0.5 * dt)) # half Kerr
|
|
51
|
+
return psi
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def homogeneous_steady_states(F, alpha):
|
|
55
|
+
"""Real intensities rho = |psi|^2 of the flat steady states.
|
|
56
|
+
|
|
57
|
+
Roots of rho * (1 + (alpha - rho)^2) = F^2. Returns the real,
|
|
58
|
+
non-negative roots in ascending order.
|
|
59
|
+
"""
|
|
60
|
+
# rho^3 - 2 alpha rho^2 + (1 + alpha^2) rho - F^2 = 0
|
|
61
|
+
roots = np.roots([1.0, -2.0 * alpha, 1.0 + alpha * alpha, -float(F) ** 2])
|
|
62
|
+
real = roots[np.abs(roots.imag) < 1e-9].real
|
|
63
|
+
return np.sort(real[real >= 0.0])
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Output quadrature-noise spectra via input-output theory.
|
|
2
|
+
|
|
3
|
+
The cavity couples to the extraction port with rate fraction eta = kappa_ex
|
|
4
|
+
/ kappa and to intrinsic loss with 1 - eta (total damping normalized to 1
|
|
5
|
+
in the doubled drift matrix M, i.e. Re eigenvalues -> -1 far from any
|
|
6
|
+
parametric process). With vacuum at both inputs,
|
|
7
|
+
|
|
8
|
+
z(Omega) = G(Omega) [ sqrt(2 eta) z_ex + sqrt(2 (1-eta)) z_0 ]
|
|
9
|
+
z_out(Omega) = sqrt(2 eta) z(Omega) - z_ex(Omega)
|
|
10
|
+
G(Omega) = (-i Omega I - M)^{-1}
|
|
11
|
+
|
|
12
|
+
and the symmetrized output covariance follows from the vacuum input
|
|
13
|
+
covariance. Quadrature X_phi = (a e^{-i phi} + a^dagger e^{i phi}) /
|
|
14
|
+
sqrt(2), vacuum variance 1/2.
|
|
15
|
+
"""
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import numpy as np
|
|
19
|
+
|
|
20
|
+
from .linearize import is_stable
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _output_covariance(M, eta, omega):
|
|
24
|
+
m2 = M.shape[0]
|
|
25
|
+
ident = np.eye(m2, dtype=complex)
|
|
26
|
+
G = np.linalg.inv(-1j * omega * ident - M)
|
|
27
|
+
T_ex = 2.0 * eta * G - ident
|
|
28
|
+
T_0 = 2.0 * np.sqrt(eta * (1.0 - eta)) * G
|
|
29
|
+
# vacuum covariance <z_in z_in^dagger> in the (a, a*) doubled ordering:
|
|
30
|
+
# <a a^dagger> = 1, all other blocks zero
|
|
31
|
+
half = m2 // 2
|
|
32
|
+
N = np.zeros((m2, m2), dtype=complex)
|
|
33
|
+
N[:half, :half] = np.eye(half)
|
|
34
|
+
S = T_ex @ N @ T_ex.conj().T + T_0 @ N @ T_0.conj().T
|
|
35
|
+
return S
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def output_quadrature_variance(M, eta, omega, mode_index, n_modes,
|
|
39
|
+
phi=0.0, mode_index_b=None):
|
|
40
|
+
"""Symmetrized variance of an output quadrature at frequency omega.
|
|
41
|
+
|
|
42
|
+
mode_index : index of the mode (within the retained mode list) whose
|
|
43
|
+
quadrature is detected. If mode_index_b is given, the joint
|
|
44
|
+
two-mode quadrature (a + b)/sqrt(2) rotated by phi is used, the
|
|
45
|
+
natural variable for twin-beam squeezing.
|
|
46
|
+
Vacuum level is 0.5. Requires a stable M.
|
|
47
|
+
"""
|
|
48
|
+
if not is_stable(M):
|
|
49
|
+
raise ValueError("drift matrix is unstable (above threshold); "
|
|
50
|
+
"linearized spectra are meaningless there")
|
|
51
|
+
S = _output_covariance(M, eta, omega)
|
|
52
|
+
u = np.zeros(2 * n_modes, dtype=complex)
|
|
53
|
+
if mode_index_b is None:
|
|
54
|
+
u[mode_index] = np.exp(-1j * phi) / np.sqrt(2.0)
|
|
55
|
+
u[n_modes + mode_index] = np.exp(1j * phi) / np.sqrt(2.0)
|
|
56
|
+
else:
|
|
57
|
+
for idx, w in ((mode_index, 0.5), (mode_index_b, 0.5)):
|
|
58
|
+
u[idx] += np.exp(-1j * phi) * w
|
|
59
|
+
u[n_modes + idx] += np.exp(1j * phi) * w
|
|
60
|
+
# With N giving <a a^dagger> = 1 and zero elsewhere, u^dag S u is the
|
|
61
|
+
# output quadrature spectrum with vacuum level exactly 1/2; the
|
|
62
|
+
# passive-cavity identity (T_ex N T_ex^dag + T_0 N T_0^dag = N for any
|
|
63
|
+
# eta, Omega) is verified in the test-suite.
|
|
64
|
+
var = np.real(u.conj() @ S @ u)
|
|
65
|
+
return float(var)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def squeezing_db(variance):
|
|
69
|
+
"""Convert a quadrature variance to dB relative to vacuum (0.5)."""
|
|
70
|
+
return 10.0 * np.log10(variance / 0.5)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqzcomb
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Squeezed light in Kerr microcombs: Lugiato-Lefever steady states, linearized quantum noise, and detected output spectra
|
|
5
|
+
Author-email: "Tanvir M. Mahim" <tanvir.mahim@bracu.ac.bd>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://tanvir-mahmud-mahim.github.io/software/
|
|
8
|
+
Project-URL: Repository, https://github.com/TaN-MM-Org/sqzcomb
|
|
9
|
+
Project-URL: Issues, https://github.com/TaN-MM-Org/sqzcomb/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/TaN-MM-Org/sqzcomb/releases
|
|
11
|
+
Keywords: squeezed light,microcomb,Kerr,Lugiato-Lefever,quantum optics,homodyne
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: numpy>=1.22
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: pytest; extra == "test"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# sqzcomb
|
|
26
|
+
|
|
27
|
+
[](https://doi.org/10.5281/zenodo.22015375) [](https://github.com/TaN-MM-Org/sqzcomb/actions)
|
|
28
|
+
|
|
29
|
+
Squeezed light in Kerr microcombs, computed **end to end**: from the
|
|
30
|
+
classical Lugiato-Lefever steady state, through the linearized quantum
|
|
31
|
+
fluctuations around it, to the **output quadrature-noise spectrum a
|
|
32
|
+
homodyne detector would report**. The package exists because intracavity
|
|
33
|
+
squeezing is not the observable; what leaves the extraction port is, and
|
|
34
|
+
the coupling that maximizes one does not maximize the other.
|
|
35
|
+
|
|
36
|
+
## Status
|
|
37
|
+
|
|
38
|
+
v0.1.0 (alpha). Implemented and tested:
|
|
39
|
+
|
|
40
|
+
- Lugiato-Lefever solver (Strang splitting; the Kerr step and the
|
|
41
|
+
linear-plus-pump step are each exact)
|
|
42
|
+
- homogeneous steady states against the exact cubic
|
|
43
|
+
- linearized fluctuation (Bogoliubov) matrix around an arbitrary steady
|
|
44
|
+
state, with a stability guard that refuses above-threshold states
|
|
45
|
+
- input-output quadrature spectra with an extraction port and intrinsic
|
|
46
|
+
loss; single-mode and joint two-mode quadratures
|
|
47
|
+
|
|
48
|
+
Verified against closed forms in the test-suite: vacuum passes a passive
|
|
49
|
+
cavity unchanged for every coupling and frequency; the degenerate
|
|
50
|
+
parametric oscillator output spectrum is reproduced to 1e-10; and the
|
|
51
|
+
textbook result that detectable squeezing saturates at 3 dB at critical
|
|
52
|
+
coupling, while full extraction breaks that limit, emerges from the
|
|
53
|
+
machinery rather than being asserted.
|
|
54
|
+
|
|
55
|
+
Not yet implemented (the v0.2+ roadmap, in order): the auxiliary-ring
|
|
56
|
+
photonic molecule and its Purcell extraction of below-threshold modes,
|
|
57
|
+
soliton-crystal steady-state continuation, supermode decomposition of the
|
|
58
|
+
multimode covariance, and thermal input noise.
|
|
59
|
+
|
|
60
|
+
## Install and use
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
pip install -e .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import numpy as np
|
|
68
|
+
from sqzcomb import (lle_evolve, fluctuation_matrix,
|
|
69
|
+
output_quadrature_variance, squeezing_db)
|
|
70
|
+
|
|
71
|
+
# steady state at pump F and detuning alpha, anomalous dispersion d2
|
|
72
|
+
psi = lle_evolve(np.full(256, 0.05 + 0j), F=1.2, alpha=0.8,
|
|
73
|
+
dispersion=(-0.02,), t_end=300.0)
|
|
74
|
+
|
|
75
|
+
M, modes = fluctuation_matrix(psi, alpha=0.8, dispersion=(-0.02,))
|
|
76
|
+
i0 = int(np.where(modes == 0)[0][0])
|
|
77
|
+
v = output_quadrature_variance(M, eta=0.5, omega=0.0,
|
|
78
|
+
mode_index=i0, n_modes=modes.size)
|
|
79
|
+
print(squeezing_db(v), "dB relative to vacuum")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Units are the standard normalized LLE units: time in photon lifetimes,
|
|
83
|
+
eta = kappa_ex / kappa, vacuum variance 1/2.
|
|
84
|
+
|
|
85
|
+
## Methodological basis
|
|
86
|
+
|
|
87
|
+
> T. M. Mahim, M. M. Rahman and A. S. M. Mohsin, "Overcoming the 3 dB
|
|
88
|
+
> squeezing extraction limit in silicon carbide microcombs with a
|
|
89
|
+
> photonic molecule" (under review); code for the paper:
|
|
90
|
+
> https://github.com/Tanvir-Mahmud-Mahim/sic-molecule-squeezer
|
|
91
|
+
|
|
92
|
+
This package is the general-purpose engine; the paper repository
|
|
93
|
+
reproduces the specific published study, including the photonic-molecule
|
|
94
|
+
extraction that this package's v0.1 does not yet contain.
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
Apache-2.0
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/sqzcomb/__init__.py
|
|
5
|
+
src/sqzcomb/linearize.py
|
|
6
|
+
src/sqzcomb/lle.py
|
|
7
|
+
src/sqzcomb/spectra.py
|
|
8
|
+
src/sqzcomb.egg-info/PKG-INFO
|
|
9
|
+
src/sqzcomb.egg-info/SOURCES.txt
|
|
10
|
+
src/sqzcomb.egg-info/dependency_links.txt
|
|
11
|
+
src/sqzcomb.egg-info/requires.txt
|
|
12
|
+
src/sqzcomb.egg-info/top_level.txt
|
|
13
|
+
tests/test_sqzcomb.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sqzcomb
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
from sqzcomb import (lle_evolve, homogeneous_steady_states,
|
|
5
|
+
fluctuation_matrix, single_mode_parametric,
|
|
6
|
+
output_quadrature_variance, squeezing_db)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_free_decay():
|
|
10
|
+
n = 64
|
|
11
|
+
psi0 = np.ones(n, dtype=complex)
|
|
12
|
+
psi = lle_evolve(psi0, F=0.0, alpha=0.0, t_end=3.0, dt=0.005)
|
|
13
|
+
assert np.allclose(np.abs(psi), np.exp(-3.0), rtol=1e-3)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def test_flat_state_matches_cubic():
|
|
17
|
+
F, alpha = 1.1, 0.5
|
|
18
|
+
rho = homogeneous_steady_states(F, alpha)
|
|
19
|
+
# evolve from small seed to the (single) flat state
|
|
20
|
+
psi = lle_evolve(np.full(32, 0.1 + 0j), F=F, alpha=alpha,
|
|
21
|
+
t_end=200.0, dt=0.01)
|
|
22
|
+
assert np.allclose(np.abs(psi) ** 2, rho[0], rtol=1e-4)
|
|
23
|
+
# residual of the cubic at the solver's intensity
|
|
24
|
+
r = np.abs(psi[0]) ** 2
|
|
25
|
+
assert np.isclose(r * (1 + (alpha - r) ** 2), F * F, rtol=1e-3)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_vacuum_passes_through_passive_cavity():
|
|
29
|
+
M = np.diag([-1.0 + 0.3j, -1.0 - 0.3j]).astype(complex)
|
|
30
|
+
rng = np.random.default_rng(0)
|
|
31
|
+
for _ in range(10):
|
|
32
|
+
eta = rng.uniform(0.05, 1.0)
|
|
33
|
+
omega = rng.uniform(-3, 3)
|
|
34
|
+
phi = rng.uniform(0, np.pi)
|
|
35
|
+
v = output_quadrature_variance(M, eta, omega, mode_index=0,
|
|
36
|
+
n_modes=1, phi=phi)
|
|
37
|
+
assert np.isclose(v, 0.5, atol=1e-12)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_matches_parametric_oscillator_closed_form():
|
|
41
|
+
# S_Y(Omega) = 1 - 4 eta mu / ((1 + mu)^2 + Omega^2), vacuum = 1
|
|
42
|
+
for mu in (0.3, 0.9):
|
|
43
|
+
M = single_mode_parametric(mu)
|
|
44
|
+
for eta in (0.3, 0.5, 1.0):
|
|
45
|
+
for omega in (0.0, 0.7, 2.5):
|
|
46
|
+
v = output_quadrature_variance(M, eta, omega, mode_index=0,
|
|
47
|
+
n_modes=1, phi=np.pi / 2)
|
|
48
|
+
analytic = 0.5 * (1 - 4 * eta * mu / ((1 + mu) ** 2 + omega ** 2))
|
|
49
|
+
assert np.isclose(v, analytic, rtol=1e-10), (mu, eta, omega)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def test_three_db_extraction_limit_at_critical_coupling():
|
|
53
|
+
# eta = 1/2: as mu -> 1 the detectable squeezing saturates at 3 dB
|
|
54
|
+
M = single_mode_parametric(0.9999)
|
|
55
|
+
v = output_quadrature_variance(M, 0.5, 0.0, 0, 1, phi=np.pi / 2)
|
|
56
|
+
assert squeezing_db(v) > -3.011
|
|
57
|
+
assert squeezing_db(v) < -2.99
|
|
58
|
+
# full extraction breaks the limit (checked away from the mu -> 1
|
|
59
|
+
# numerical degeneracy: at mu = 0.99, eta = 1 the closed form gives
|
|
60
|
+
# about -46 dB)
|
|
61
|
+
M99 = single_mode_parametric(0.99)
|
|
62
|
+
v_full = output_quadrature_variance(M99, 1.0, 0.0, 0, 1, phi=np.pi / 2)
|
|
63
|
+
assert squeezing_db(v_full) < -20.0
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def test_above_threshold_rejected():
|
|
67
|
+
M = single_mode_parametric(1.2)
|
|
68
|
+
with pytest.raises(ValueError):
|
|
69
|
+
output_quadrature_variance(M, 0.5, 0.0, 0, 1)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def test_lle_linearization_stable_below_threshold():
|
|
73
|
+
F, alpha = 0.8, 0.2
|
|
74
|
+
psi = lle_evolve(np.full(32, 0.05 + 0j), F=F, alpha=alpha,
|
|
75
|
+
t_end=200.0, dt=0.01)
|
|
76
|
+
M, modes = fluctuation_matrix(psi, alpha)
|
|
77
|
+
assert np.max(np.linalg.eigvals(M).real) < 0.0
|
|
78
|
+
# and the machinery produces a finite spectrum on the pumped mode
|
|
79
|
+
i0 = int(np.where(modes == 0)[0][0])
|
|
80
|
+
v = output_quadrature_variance(M, 0.5, 0.0, i0, modes.size)
|
|
81
|
+
assert np.isfinite(v) and v > 0.0
|