qthinking 0.0.2__tar.gz → 0.0.3__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.
- qthinking-0.0.3/PKG-INFO +190 -0
- qthinking-0.0.3/README.md +172 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/pyproject.toml +2 -2
- qthinking-0.0.3/qthinking.egg-info/PKG-INFO +190 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/setup.py +5 -6
- qthinking-0.0.2/PKG-INFO +0 -17
- qthinking-0.0.2/README.md +0 -0
- qthinking-0.0.2/qthinking.egg-info/PKG-INFO +0 -17
- {qthinking-0.0.2 → qthinking-0.0.3}/LICENSE +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/MANIFEST.in +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/__init__.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/__init__.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/_plotting.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/_validation.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/controls.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/dynamics.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/hamiltonian.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/interaction.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/measurement.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/program.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/rb87.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/results.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/sequence.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/system.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/analog/waveforms.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/__init__.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/btc_experimental.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/btc_minimal.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/btc_volatility.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/climate.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/climate_results.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/market_data.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/results.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/sp500_volatility.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/stateful.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/applications/volatility.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/backends/__init__.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/backends/base.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/backends/numpy_split_step.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/backends/qutip.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/errors.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/handoff.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/ml/__init__.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/ml/ridge.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/ml/svr.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qelm/__init__.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qelm/config.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qelm/encoding.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qelm/model.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qelm/presets.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qelm/temporal.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qrc/__init__.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qrc/presets.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking/qrc/temporal.py +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking.egg-info/SOURCES.txt +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking.egg-info/dependency_links.txt +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking.egg-info/entry_points.txt +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking.egg-info/requires.txt +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/qthinking.egg-info/top_level.txt +0 -0
- {qthinking-0.0.2 → qthinking-0.0.3}/setup.cfg +0 -0
qthinking-0.0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qthinking
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Buchow quantum simulator
|
|
5
|
+
Author: buchowatom
|
|
6
|
+
Requires-Python: >=3.12
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: matplotlib>=3.11.2
|
|
10
|
+
Requires-Dist: numpy>=2.5.4
|
|
11
|
+
Requires-Dist: qutip>=5.3.1
|
|
12
|
+
Requires-Dist: scikit-learn>=1.9.1
|
|
13
|
+
Requires-Dist: scipy>=1.18.1
|
|
14
|
+
Requires-Dist: setuptools>=84.2.1
|
|
15
|
+
Requires-Dist: twine>=7.0.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# Quantum Analog SDK
|
|
20
|
+
|
|
21
|
+
A Python SDK for neutral-atom quantum analog computing, simulation, and quantum reservoir computing.
|
|
22
|
+
|
|
23
|
+
## Overview
|
|
24
|
+
|
|
25
|
+
**Quantum Analog SDK (`qthinking`)** provides a Python interface for modeling and simulating neutral-atom quantum systems. It offers a unified API for defining analog programs, configuring time-dependent control parameters, specifying observables, executing simulations, and analyzing results.
|
|
26
|
+
|
|
27
|
+
The SDK is designed for quantum computing research, simulation workflows, and integration into quantum computing applications. It also provides quantum machine learning components, including quantum extreme learning and quantum reservoir computing workflows.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Analog Program Modeling** — Define neutral-atom systems, Rydberg Hamiltonians, initial states, and evolution parameters.
|
|
32
|
+
- **Pulse and Waveform Configuration** — Configure Rabi amplitude, phase, detuning, and supported time-dependent waveforms.
|
|
33
|
+
- **Observable Configuration** — Evaluate expectation values of observables such as \(X\), \(Y\), \(Z\), \(ZZ\), and Rydberg-state occupation.
|
|
34
|
+
- **Local Simulation** — Execute analog programs using the QuTiP simulation backend or the supported NumPy split-step backend.
|
|
35
|
+
- **Simulation Results** — Retrieve evolution times, observable expectation values, final states, and measurement results when requested.
|
|
36
|
+
- **Neutral-Atom System Support** — Model atom arrangements and configure interaction parameters, with additional helpers for Rb-87 systems.
|
|
37
|
+
- **Quantum Machine Learning** — Explore quantum extreme learning (QELM), quantum reservoir computing (QRC), and classical readout models.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
Install `qthinking` from PyPI:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m pip install qthinking
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The package requires **Python 3.12 or later**. Its declared dependencies are installed automatically by `pip`.
|
|
48
|
+
|
|
49
|
+
To verify the installation:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -c "import qthinking; print('qthinking installed successfully')"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
This example demonstrates how to define a two-atom Rydberg analog program, execute a local simulation, and inspect the results.
|
|
58
|
+
|
|
59
|
+
### 1. Create an Analog Program
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from qthinking.analog import rydberg_program
|
|
63
|
+
from qthinking.backends import QutipBackend
|
|
64
|
+
|
|
65
|
+
# Define a two-atom Rydberg system.
|
|
66
|
+
program = rydberg_program(
|
|
67
|
+
n_atoms=2,
|
|
68
|
+
rabi_amplitude=2.0,
|
|
69
|
+
rabi_phase=0.0,
|
|
70
|
+
detuning=1.0,
|
|
71
|
+
interaction=3.0,
|
|
72
|
+
duration_us=1.0,
|
|
73
|
+
observables=("Z", "occupation"),
|
|
74
|
+
n_virtual_nodes=10,
|
|
75
|
+
return_final_state=True,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Execute the program using the QuTiP backend.
|
|
79
|
+
backend = QutipBackend()
|
|
80
|
+
result = backend.run(program)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `rydberg_program()` function creates an analog program with constant control parameters unless waveforms are explicitly provided.
|
|
84
|
+
|
|
85
|
+
In this example:
|
|
86
|
+
|
|
87
|
+
- `n_atoms` specifies the number of atoms.
|
|
88
|
+
- `rabi_amplitude` and `rabi_phase` configure the driving field.
|
|
89
|
+
- `detuning` specifies the detuning parameter.
|
|
90
|
+
- `interaction` defines the pairwise interaction strength.
|
|
91
|
+
- `duration_us` sets the evolution duration in microseconds.
|
|
92
|
+
- `observables` selects the quantities to evaluate.
|
|
93
|
+
- `n_virtual_nodes` requests measurements at uniformly spaced evolution times.
|
|
94
|
+
- `return_final_state=True` requests the final quantum state.
|
|
95
|
+
|
|
96
|
+
Frequency and interaction parameters use the SDK's angular-frequency convention (`rad/us`), while evolution time is measured in microseconds.
|
|
97
|
+
|
|
98
|
+
### 2. Inspect the Simulation Results
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
# Print the simulation backend.
|
|
102
|
+
print("Backend:", result.metadata["backend"])
|
|
103
|
+
|
|
104
|
+
# Retrieve the evolution times.
|
|
105
|
+
print("Evolution times (us):", result.times_us)
|
|
106
|
+
|
|
107
|
+
# Retrieve observable expectation values.
|
|
108
|
+
print("Z expectation values for atom 0:")
|
|
109
|
+
print(result.expectations["Z_0"])
|
|
110
|
+
|
|
111
|
+
print("Rydberg occupation for atom 0:")
|
|
112
|
+
print(result.expectations["N_0"])
|
|
113
|
+
|
|
114
|
+
# Retrieve the final density matrix.
|
|
115
|
+
if result.final_state is not None:
|
|
116
|
+
print("Final state:")
|
|
117
|
+
print(result.final_state)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The simulation result provides:
|
|
121
|
+
|
|
122
|
+
- **`result.times_us`** — The evolution times at which measurements are evaluated.
|
|
123
|
+
- **`result.expectations`** — A mapping from observable names to their time-dependent expectation values, such as `Z_0`, `Z_1`, `N_0`, and `N_1`.
|
|
124
|
+
- **`result.final_state`** — The final quantum state when requested.
|
|
125
|
+
- **`result.metadata`** — Execution metadata, including the backend name.
|
|
126
|
+
|
|
127
|
+
### 3. Visualize the Results
|
|
128
|
+
|
|
129
|
+
The simulation result also provides a plotting method for inspecting observable trajectories.
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
# Plot all available expectation-value trajectories.
|
|
133
|
+
fig = result.show()
|
|
134
|
+
|
|
135
|
+
# Save the figure.
|
|
136
|
+
fig.savefig("analog_simulation_results.png", dpi=150)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
This provides a convenient way to inspect the evolution of the selected observables.
|
|
140
|
+
|
|
141
|
+
## Typical Workflow
|
|
142
|
+
|
|
143
|
+
A typical analog simulation workflow consists of the following steps:
|
|
144
|
+
|
|
145
|
+
1. Define the neutral-atom system and interaction parameters.
|
|
146
|
+
2. Configure the driving fields and evolution duration.
|
|
147
|
+
3. Select the observables and measurement times.
|
|
148
|
+
4. Execute the program using a compatible simulation backend.
|
|
149
|
+
5. Analyze the resulting expectation values and final quantum state.
|
|
150
|
+
|
|
151
|
+
## Supported Capabilities
|
|
152
|
+
|
|
153
|
+
The SDK provides components for the following workflows:
|
|
154
|
+
|
|
155
|
+
- **Analog Simulation:** Construct and execute neutral-atom analog programs.
|
|
156
|
+
- **Control Configuration:** Configure constant controls and supported waveform types, including linear and Blackman waveforms.
|
|
157
|
+
- **Observable Evaluation:** Evaluate single-atom and pairwise observables, as supported by the selected program and backend.
|
|
158
|
+
- **Simulation Backends:** Run programs using QuTiP or the supported NumPy split-step implementation.
|
|
159
|
+
- **Rb-87 Modeling:** Use the available Rb-87 program helpers and triangular-array models.
|
|
160
|
+
- **Quantum Machine Learning:** Build QELM and QRC workflows and use classical machine learning readout models.
|
|
161
|
+
|
|
162
|
+
Backend support depends on the program configuration. For example, the NumPy split-step backend supports a more restricted set of programs than the QuTiP backend.
|
|
163
|
+
|
|
164
|
+
## Requirements
|
|
165
|
+
|
|
166
|
+
- **Python:** 3.12 or later.
|
|
167
|
+
- **Dependencies:** Installed automatically through `pip`.
|
|
168
|
+
- **Execution environment:** A local Python environment for running supported simulations.
|
|
169
|
+
- **Remote quantum devices:** Hardware execution requires a compatible backend integration. Installing the SDK alone does not establish access to a remote quantum device.
|
|
170
|
+
|
|
171
|
+
## Documentation
|
|
172
|
+
|
|
173
|
+
For more information, explore the package modules and examples in this repository:
|
|
174
|
+
|
|
175
|
+
- `qthinking.analog` — Analog program construction, controls, waveforms, systems, and observables.
|
|
176
|
+
- `qthinking.backends` — Simulation backend implementations.
|
|
177
|
+
- `qthinking.qelm` — Quantum extreme learning components.
|
|
178
|
+
- `qthinking.qrc` — Quantum reservoir computing components.
|
|
179
|
+
- `qthinking.ml` — Classical machine learning models.
|
|
180
|
+
- `qthinking.applications` — Application-oriented examples and workflows.
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
Copyright (c) 2018 Python Packaging Authority
|
|
185
|
+
|
|
186
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
187
|
+
|
|
188
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
189
|
+
|
|
190
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Quantum Analog SDK
|
|
2
|
+
|
|
3
|
+
A Python SDK for neutral-atom quantum analog computing, simulation, and quantum reservoir computing.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
**Quantum Analog SDK (`qthinking`)** provides a Python interface for modeling and simulating neutral-atom quantum systems. It offers a unified API for defining analog programs, configuring time-dependent control parameters, specifying observables, executing simulations, and analyzing results.
|
|
8
|
+
|
|
9
|
+
The SDK is designed for quantum computing research, simulation workflows, and integration into quantum computing applications. It also provides quantum machine learning components, including quantum extreme learning and quantum reservoir computing workflows.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Analog Program Modeling** — Define neutral-atom systems, Rydberg Hamiltonians, initial states, and evolution parameters.
|
|
14
|
+
- **Pulse and Waveform Configuration** — Configure Rabi amplitude, phase, detuning, and supported time-dependent waveforms.
|
|
15
|
+
- **Observable Configuration** — Evaluate expectation values of observables such as \(X\), \(Y\), \(Z\), \(ZZ\), and Rydberg-state occupation.
|
|
16
|
+
- **Local Simulation** — Execute analog programs using the QuTiP simulation backend or the supported NumPy split-step backend.
|
|
17
|
+
- **Simulation Results** — Retrieve evolution times, observable expectation values, final states, and measurement results when requested.
|
|
18
|
+
- **Neutral-Atom System Support** — Model atom arrangements and configure interaction parameters, with additional helpers for Rb-87 systems.
|
|
19
|
+
- **Quantum Machine Learning** — Explore quantum extreme learning (QELM), quantum reservoir computing (QRC), and classical readout models.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Install `qthinking` from PyPI:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python -m pip install qthinking
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The package requires **Python 3.12 or later**. Its declared dependencies are installed automatically by `pip`.
|
|
30
|
+
|
|
31
|
+
To verify the installation:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -c "import qthinking; print('qthinking installed successfully')"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
This example demonstrates how to define a two-atom Rydberg analog program, execute a local simulation, and inspect the results.
|
|
40
|
+
|
|
41
|
+
### 1. Create an Analog Program
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from qthinking.analog import rydberg_program
|
|
45
|
+
from qthinking.backends import QutipBackend
|
|
46
|
+
|
|
47
|
+
# Define a two-atom Rydberg system.
|
|
48
|
+
program = rydberg_program(
|
|
49
|
+
n_atoms=2,
|
|
50
|
+
rabi_amplitude=2.0,
|
|
51
|
+
rabi_phase=0.0,
|
|
52
|
+
detuning=1.0,
|
|
53
|
+
interaction=3.0,
|
|
54
|
+
duration_us=1.0,
|
|
55
|
+
observables=("Z", "occupation"),
|
|
56
|
+
n_virtual_nodes=10,
|
|
57
|
+
return_final_state=True,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# Execute the program using the QuTiP backend.
|
|
61
|
+
backend = QutipBackend()
|
|
62
|
+
result = backend.run(program)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The `rydberg_program()` function creates an analog program with constant control parameters unless waveforms are explicitly provided.
|
|
66
|
+
|
|
67
|
+
In this example:
|
|
68
|
+
|
|
69
|
+
- `n_atoms` specifies the number of atoms.
|
|
70
|
+
- `rabi_amplitude` and `rabi_phase` configure the driving field.
|
|
71
|
+
- `detuning` specifies the detuning parameter.
|
|
72
|
+
- `interaction` defines the pairwise interaction strength.
|
|
73
|
+
- `duration_us` sets the evolution duration in microseconds.
|
|
74
|
+
- `observables` selects the quantities to evaluate.
|
|
75
|
+
- `n_virtual_nodes` requests measurements at uniformly spaced evolution times.
|
|
76
|
+
- `return_final_state=True` requests the final quantum state.
|
|
77
|
+
|
|
78
|
+
Frequency and interaction parameters use the SDK's angular-frequency convention (`rad/us`), while evolution time is measured in microseconds.
|
|
79
|
+
|
|
80
|
+
### 2. Inspect the Simulation Results
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
# Print the simulation backend.
|
|
84
|
+
print("Backend:", result.metadata["backend"])
|
|
85
|
+
|
|
86
|
+
# Retrieve the evolution times.
|
|
87
|
+
print("Evolution times (us):", result.times_us)
|
|
88
|
+
|
|
89
|
+
# Retrieve observable expectation values.
|
|
90
|
+
print("Z expectation values for atom 0:")
|
|
91
|
+
print(result.expectations["Z_0"])
|
|
92
|
+
|
|
93
|
+
print("Rydberg occupation for atom 0:")
|
|
94
|
+
print(result.expectations["N_0"])
|
|
95
|
+
|
|
96
|
+
# Retrieve the final density matrix.
|
|
97
|
+
if result.final_state is not None:
|
|
98
|
+
print("Final state:")
|
|
99
|
+
print(result.final_state)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The simulation result provides:
|
|
103
|
+
|
|
104
|
+
- **`result.times_us`** — The evolution times at which measurements are evaluated.
|
|
105
|
+
- **`result.expectations`** — A mapping from observable names to their time-dependent expectation values, such as `Z_0`, `Z_1`, `N_0`, and `N_1`.
|
|
106
|
+
- **`result.final_state`** — The final quantum state when requested.
|
|
107
|
+
- **`result.metadata`** — Execution metadata, including the backend name.
|
|
108
|
+
|
|
109
|
+
### 3. Visualize the Results
|
|
110
|
+
|
|
111
|
+
The simulation result also provides a plotting method for inspecting observable trajectories.
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# Plot all available expectation-value trajectories.
|
|
115
|
+
fig = result.show()
|
|
116
|
+
|
|
117
|
+
# Save the figure.
|
|
118
|
+
fig.savefig("analog_simulation_results.png", dpi=150)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
This provides a convenient way to inspect the evolution of the selected observables.
|
|
122
|
+
|
|
123
|
+
## Typical Workflow
|
|
124
|
+
|
|
125
|
+
A typical analog simulation workflow consists of the following steps:
|
|
126
|
+
|
|
127
|
+
1. Define the neutral-atom system and interaction parameters.
|
|
128
|
+
2. Configure the driving fields and evolution duration.
|
|
129
|
+
3. Select the observables and measurement times.
|
|
130
|
+
4. Execute the program using a compatible simulation backend.
|
|
131
|
+
5. Analyze the resulting expectation values and final quantum state.
|
|
132
|
+
|
|
133
|
+
## Supported Capabilities
|
|
134
|
+
|
|
135
|
+
The SDK provides components for the following workflows:
|
|
136
|
+
|
|
137
|
+
- **Analog Simulation:** Construct and execute neutral-atom analog programs.
|
|
138
|
+
- **Control Configuration:** Configure constant controls and supported waveform types, including linear and Blackman waveforms.
|
|
139
|
+
- **Observable Evaluation:** Evaluate single-atom and pairwise observables, as supported by the selected program and backend.
|
|
140
|
+
- **Simulation Backends:** Run programs using QuTiP or the supported NumPy split-step implementation.
|
|
141
|
+
- **Rb-87 Modeling:** Use the available Rb-87 program helpers and triangular-array models.
|
|
142
|
+
- **Quantum Machine Learning:** Build QELM and QRC workflows and use classical machine learning readout models.
|
|
143
|
+
|
|
144
|
+
Backend support depends on the program configuration. For example, the NumPy split-step backend supports a more restricted set of programs than the QuTiP backend.
|
|
145
|
+
|
|
146
|
+
## Requirements
|
|
147
|
+
|
|
148
|
+
- **Python:** 3.12 or later.
|
|
149
|
+
- **Dependencies:** Installed automatically through `pip`.
|
|
150
|
+
- **Execution environment:** A local Python environment for running supported simulations.
|
|
151
|
+
- **Remote quantum devices:** Hardware execution requires a compatible backend integration. Installing the SDK alone does not establish access to a remote quantum device.
|
|
152
|
+
|
|
153
|
+
## Documentation
|
|
154
|
+
|
|
155
|
+
For more information, explore the package modules and examples in this repository:
|
|
156
|
+
|
|
157
|
+
- `qthinking.analog` — Analog program construction, controls, waveforms, systems, and observables.
|
|
158
|
+
- `qthinking.backends` — Simulation backend implementations.
|
|
159
|
+
- `qthinking.qelm` — Quantum extreme learning components.
|
|
160
|
+
- `qthinking.qrc` — Quantum reservoir computing components.
|
|
161
|
+
- `qthinking.ml` — Classical machine learning models.
|
|
162
|
+
- `qthinking.applications` — Application-oriented examples and workflows.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
Copyright (c) 2018 Python Packaging Authority
|
|
167
|
+
|
|
168
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
169
|
+
|
|
170
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
171
|
+
|
|
172
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qthinking
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Buchow quantum simulator
|
|
5
|
+
Author: buchowatom
|
|
6
|
+
Requires-Python: >=3.12
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: matplotlib>=3.11.2
|
|
10
|
+
Requires-Dist: numpy>=2.5.4
|
|
11
|
+
Requires-Dist: qutip>=5.3.1
|
|
12
|
+
Requires-Dist: scikit-learn>=1.9.1
|
|
13
|
+
Requires-Dist: scipy>=1.18.1
|
|
14
|
+
Requires-Dist: setuptools>=84.2.1
|
|
15
|
+
Requires-Dist: twine>=7.0.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# Quantum Analog SDK
|
|
20
|
+
|
|
21
|
+
A Python SDK for neutral-atom quantum analog computing, simulation, and quantum reservoir computing.
|
|
22
|
+
|
|
23
|
+
## Overview
|
|
24
|
+
|
|
25
|
+
**Quantum Analog SDK (`qthinking`)** provides a Python interface for modeling and simulating neutral-atom quantum systems. It offers a unified API for defining analog programs, configuring time-dependent control parameters, specifying observables, executing simulations, and analyzing results.
|
|
26
|
+
|
|
27
|
+
The SDK is designed for quantum computing research, simulation workflows, and integration into quantum computing applications. It also provides quantum machine learning components, including quantum extreme learning and quantum reservoir computing workflows.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Analog Program Modeling** — Define neutral-atom systems, Rydberg Hamiltonians, initial states, and evolution parameters.
|
|
32
|
+
- **Pulse and Waveform Configuration** — Configure Rabi amplitude, phase, detuning, and supported time-dependent waveforms.
|
|
33
|
+
- **Observable Configuration** — Evaluate expectation values of observables such as \(X\), \(Y\), \(Z\), \(ZZ\), and Rydberg-state occupation.
|
|
34
|
+
- **Local Simulation** — Execute analog programs using the QuTiP simulation backend or the supported NumPy split-step backend.
|
|
35
|
+
- **Simulation Results** — Retrieve evolution times, observable expectation values, final states, and measurement results when requested.
|
|
36
|
+
- **Neutral-Atom System Support** — Model atom arrangements and configure interaction parameters, with additional helpers for Rb-87 systems.
|
|
37
|
+
- **Quantum Machine Learning** — Explore quantum extreme learning (QELM), quantum reservoir computing (QRC), and classical readout models.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
Install `qthinking` from PyPI:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m pip install qthinking
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The package requires **Python 3.12 or later**. Its declared dependencies are installed automatically by `pip`.
|
|
48
|
+
|
|
49
|
+
To verify the installation:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -c "import qthinking; print('qthinking installed successfully')"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
This example demonstrates how to define a two-atom Rydberg analog program, execute a local simulation, and inspect the results.
|
|
58
|
+
|
|
59
|
+
### 1. Create an Analog Program
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from qthinking.analog import rydberg_program
|
|
63
|
+
from qthinking.backends import QutipBackend
|
|
64
|
+
|
|
65
|
+
# Define a two-atom Rydberg system.
|
|
66
|
+
program = rydberg_program(
|
|
67
|
+
n_atoms=2,
|
|
68
|
+
rabi_amplitude=2.0,
|
|
69
|
+
rabi_phase=0.0,
|
|
70
|
+
detuning=1.0,
|
|
71
|
+
interaction=3.0,
|
|
72
|
+
duration_us=1.0,
|
|
73
|
+
observables=("Z", "occupation"),
|
|
74
|
+
n_virtual_nodes=10,
|
|
75
|
+
return_final_state=True,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Execute the program using the QuTiP backend.
|
|
79
|
+
backend = QutipBackend()
|
|
80
|
+
result = backend.run(program)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `rydberg_program()` function creates an analog program with constant control parameters unless waveforms are explicitly provided.
|
|
84
|
+
|
|
85
|
+
In this example:
|
|
86
|
+
|
|
87
|
+
- `n_atoms` specifies the number of atoms.
|
|
88
|
+
- `rabi_amplitude` and `rabi_phase` configure the driving field.
|
|
89
|
+
- `detuning` specifies the detuning parameter.
|
|
90
|
+
- `interaction` defines the pairwise interaction strength.
|
|
91
|
+
- `duration_us` sets the evolution duration in microseconds.
|
|
92
|
+
- `observables` selects the quantities to evaluate.
|
|
93
|
+
- `n_virtual_nodes` requests measurements at uniformly spaced evolution times.
|
|
94
|
+
- `return_final_state=True` requests the final quantum state.
|
|
95
|
+
|
|
96
|
+
Frequency and interaction parameters use the SDK's angular-frequency convention (`rad/us`), while evolution time is measured in microseconds.
|
|
97
|
+
|
|
98
|
+
### 2. Inspect the Simulation Results
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
# Print the simulation backend.
|
|
102
|
+
print("Backend:", result.metadata["backend"])
|
|
103
|
+
|
|
104
|
+
# Retrieve the evolution times.
|
|
105
|
+
print("Evolution times (us):", result.times_us)
|
|
106
|
+
|
|
107
|
+
# Retrieve observable expectation values.
|
|
108
|
+
print("Z expectation values for atom 0:")
|
|
109
|
+
print(result.expectations["Z_0"])
|
|
110
|
+
|
|
111
|
+
print("Rydberg occupation for atom 0:")
|
|
112
|
+
print(result.expectations["N_0"])
|
|
113
|
+
|
|
114
|
+
# Retrieve the final density matrix.
|
|
115
|
+
if result.final_state is not None:
|
|
116
|
+
print("Final state:")
|
|
117
|
+
print(result.final_state)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The simulation result provides:
|
|
121
|
+
|
|
122
|
+
- **`result.times_us`** — The evolution times at which measurements are evaluated.
|
|
123
|
+
- **`result.expectations`** — A mapping from observable names to their time-dependent expectation values, such as `Z_0`, `Z_1`, `N_0`, and `N_1`.
|
|
124
|
+
- **`result.final_state`** — The final quantum state when requested.
|
|
125
|
+
- **`result.metadata`** — Execution metadata, including the backend name.
|
|
126
|
+
|
|
127
|
+
### 3. Visualize the Results
|
|
128
|
+
|
|
129
|
+
The simulation result also provides a plotting method for inspecting observable trajectories.
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
# Plot all available expectation-value trajectories.
|
|
133
|
+
fig = result.show()
|
|
134
|
+
|
|
135
|
+
# Save the figure.
|
|
136
|
+
fig.savefig("analog_simulation_results.png", dpi=150)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
This provides a convenient way to inspect the evolution of the selected observables.
|
|
140
|
+
|
|
141
|
+
## Typical Workflow
|
|
142
|
+
|
|
143
|
+
A typical analog simulation workflow consists of the following steps:
|
|
144
|
+
|
|
145
|
+
1. Define the neutral-atom system and interaction parameters.
|
|
146
|
+
2. Configure the driving fields and evolution duration.
|
|
147
|
+
3. Select the observables and measurement times.
|
|
148
|
+
4. Execute the program using a compatible simulation backend.
|
|
149
|
+
5. Analyze the resulting expectation values and final quantum state.
|
|
150
|
+
|
|
151
|
+
## Supported Capabilities
|
|
152
|
+
|
|
153
|
+
The SDK provides components for the following workflows:
|
|
154
|
+
|
|
155
|
+
- **Analog Simulation:** Construct and execute neutral-atom analog programs.
|
|
156
|
+
- **Control Configuration:** Configure constant controls and supported waveform types, including linear and Blackman waveforms.
|
|
157
|
+
- **Observable Evaluation:** Evaluate single-atom and pairwise observables, as supported by the selected program and backend.
|
|
158
|
+
- **Simulation Backends:** Run programs using QuTiP or the supported NumPy split-step implementation.
|
|
159
|
+
- **Rb-87 Modeling:** Use the available Rb-87 program helpers and triangular-array models.
|
|
160
|
+
- **Quantum Machine Learning:** Build QELM and QRC workflows and use classical machine learning readout models.
|
|
161
|
+
|
|
162
|
+
Backend support depends on the program configuration. For example, the NumPy split-step backend supports a more restricted set of programs than the QuTiP backend.
|
|
163
|
+
|
|
164
|
+
## Requirements
|
|
165
|
+
|
|
166
|
+
- **Python:** 3.12 or later.
|
|
167
|
+
- **Dependencies:** Installed automatically through `pip`.
|
|
168
|
+
- **Execution environment:** A local Python environment for running supported simulations.
|
|
169
|
+
- **Remote quantum devices:** Hardware execution requires a compatible backend integration. Installing the SDK alone does not establish access to a remote quantum device.
|
|
170
|
+
|
|
171
|
+
## Documentation
|
|
172
|
+
|
|
173
|
+
For more information, explore the package modules and examples in this repository:
|
|
174
|
+
|
|
175
|
+
- `qthinking.analog` — Analog program construction, controls, waveforms, systems, and observables.
|
|
176
|
+
- `qthinking.backends` — Simulation backend implementations.
|
|
177
|
+
- `qthinking.qelm` — Quantum extreme learning components.
|
|
178
|
+
- `qthinking.qrc` — Quantum reservoir computing components.
|
|
179
|
+
- `qthinking.ml` — Classical machine learning models.
|
|
180
|
+
- `qthinking.applications` — Application-oriented examples and workflows.
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
Copyright (c) 2018 Python Packaging Authority
|
|
185
|
+
|
|
186
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
187
|
+
|
|
188
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
189
|
+
|
|
190
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -21,12 +21,11 @@ setup(
|
|
|
21
21
|
include_package_data=True,
|
|
22
22
|
packages=find_packages(include=["qthinking", "qthinking.*"]),
|
|
23
23
|
install_requires=[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'pygments'
|
|
24
|
+
"matplotlib>=3.11.2",
|
|
25
|
+
"numpy>=2.5.4",
|
|
26
|
+
"qutip>=5.3.1",
|
|
27
|
+
"scikit-learn>=1.9.1",
|
|
28
|
+
"scipy>=1.18.1",
|
|
30
29
|
],
|
|
31
30
|
classifiers=[
|
|
32
31
|
'Operating System :: OS Independent',
|
qthinking-0.0.2/PKG-INFO
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: qthinking
|
|
3
|
-
Version: 0.0.2
|
|
4
|
-
Summary: Add your description here
|
|
5
|
-
Author: buchowatom
|
|
6
|
-
Requires-Python: >=3.12
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Requires-Dist: matplotlib>=3.11.2
|
|
10
|
-
Requires-Dist: numpy>=2.5.4
|
|
11
|
-
Requires-Dist: qutip>=5.3.1
|
|
12
|
-
Requires-Dist: scikit-learn>=1.9.1
|
|
13
|
-
Requires-Dist: scipy>=1.18.1
|
|
14
|
-
Requires-Dist: setuptools>=84.2.1
|
|
15
|
-
Requires-Dist: twine>=7.0.0
|
|
16
|
-
Dynamic: author
|
|
17
|
-
Dynamic: license-file
|
qthinking-0.0.2/README.md
DELETED
|
File without changes
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: qthinking
|
|
3
|
-
Version: 0.0.2
|
|
4
|
-
Summary: Add your description here
|
|
5
|
-
Author: buchowatom
|
|
6
|
-
Requires-Python: >=3.12
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Requires-Dist: matplotlib>=3.11.2
|
|
10
|
-
Requires-Dist: numpy>=2.5.4
|
|
11
|
-
Requires-Dist: qutip>=5.3.1
|
|
12
|
-
Requires-Dist: scikit-learn>=1.9.1
|
|
13
|
-
Requires-Dist: scipy>=1.18.1
|
|
14
|
-
Requires-Dist: setuptools>=84.2.1
|
|
15
|
-
Requires-Dist: twine>=7.0.0
|
|
16
|
-
Dynamic: author
|
|
17
|
-
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|