quantum-simulator 0.1.5__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.
- quantum_simulator-0.1.5/.gitignore +207 -0
- quantum_simulator-0.1.5/LICENSE +24 -0
- quantum_simulator-0.1.5/PKG-INFO +135 -0
- quantum_simulator-0.1.5/README.md +85 -0
- quantum_simulator-0.1.5/docs/development/changelog.md +65 -0
- quantum_simulator-0.1.5/docs/development/contributing.md +37 -0
- quantum_simulator-0.1.5/docs/development/publishing.md +248 -0
- quantum_simulator-0.1.5/docs/gen_ref_pages.py +36 -0
- quantum_simulator-0.1.5/docs/getting-started/installation.md +117 -0
- quantum_simulator-0.1.5/docs/getting-started/quickstart.md +123 -0
- quantum_simulator-0.1.5/docs/index.md +46 -0
- quantum_simulator-0.1.5/docs/javascripts/mathjax.js +12 -0
- quantum_simulator-0.1.5/docs/math/circuits/examples.md +440 -0
- quantum_simulator-0.1.5/docs/math/circuits/representation.md +398 -0
- quantum_simulator-0.1.5/docs/math/gates/cnot_gate.md +342 -0
- quantum_simulator-0.1.5/docs/math/gates/h_gate.md +337 -0
- quantum_simulator-0.1.5/docs/math/gates/x_gate.md +179 -0
- quantum_simulator-0.1.5/docs/math/gates/y_gate.md +211 -0
- quantum_simulator-0.1.5/docs/math/gates/z_gate.md +252 -0
- quantum_simulator-0.1.5/docs/math/overview.md +42 -0
- quantum_simulator-0.1.5/docs/math/quantum-mechanics/entanglement.md +193 -0
- quantum_simulator-0.1.5/docs/math/quantum-mechanics/measurement.md +204 -0
- quantum_simulator-0.1.5/docs/math/quantum-mechanics/qubits_states.md +102 -0
- quantum_simulator-0.1.5/docs/math/quantum-mechanics/superposition.md +138 -0
- quantum_simulator-0.1.5/docs/math/supported-notation.md +100 -0
- quantum_simulator-0.1.5/pyproject.toml +142 -0
- quantum_simulator-0.1.5/src/main.py +37 -0
- quantum_simulator-0.1.5/src/quantum_simulator/__init__.py +15 -0
- quantum_simulator-0.1.5/src/quantum_simulator/circuits.py +48 -0
- quantum_simulator-0.1.5/src/quantum_simulator/gates.py +96 -0
- quantum_simulator-0.1.5/src/quantum_simulator/simulator.py +64 -0
- quantum_simulator-0.1.5/tests/__init__.py +1 -0
- quantum_simulator-0.1.5/tests/test_quantum_simulator.py +131 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quantum-simulator
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Summary: A Python library for simulating quantum computers and quantum algorithms
|
|
5
|
+
Project-URL: Homepage, https://github.com/beefy/quantum-simulator
|
|
6
|
+
Project-URL: Documentation, https://beefy.github.io/quantum-simulator/
|
|
7
|
+
Project-URL: Repository, https://github.com/beefy/quantum-simulator.git
|
|
8
|
+
Project-URL: Issues, https://github.com/beefy/quantum-simulator/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/beefy/quantum-simulator/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Nathaniel Schultz <nate.schultz@outlook.com>
|
|
11
|
+
Maintainer-email: Nathaniel Schultz <nate.schultz@outlook.com>
|
|
12
|
+
License: Unlicense
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: computing,quantum,quantum-algorithms,simulation
|
|
15
|
+
Classifier: Development Status :: 3 - Alpha
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: Public Domain
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Requires-Python: >=3.8
|
|
29
|
+
Requires-Dist: numpy>=1.20.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: black; extra == 'dev'
|
|
32
|
+
Requires-Dist: flake8; extra == 'dev'
|
|
33
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
34
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest>=6.0; extra == 'dev'
|
|
37
|
+
Provides-Extra: docs
|
|
38
|
+
Requires-Dist: mkdocs-autorefs; extra == 'docs'
|
|
39
|
+
Requires-Dist: mkdocs-gen-files; extra == 'docs'
|
|
40
|
+
Requires-Dist: mkdocs-literate-nav; extra == 'docs'
|
|
41
|
+
Requires-Dist: mkdocs-material>=9.4.0; extra == 'docs'
|
|
42
|
+
Requires-Dist: mkdocs-section-index; extra == 'docs'
|
|
43
|
+
Requires-Dist: mkdocs>=1.4.0; extra == 'docs'
|
|
44
|
+
Requires-Dist: mkdocstrings[python]>=0.19.0; extra == 'docs'
|
|
45
|
+
Requires-Dist: pymdown-extensions>=9.0.0; extra == 'docs'
|
|
46
|
+
Provides-Extra: test
|
|
47
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
48
|
+
Requires-Dist: pytest>=6.0; extra == 'test'
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
|
|
51
|
+
# Quantum Simulator
|
|
52
|
+
|
|
53
|
+
[](https://github.com/beefy/quantum-simulator/actions/workflows/tests.yml)
|
|
54
|
+
[](https://badge.fury.io/py/quantum-simulator)
|
|
55
|
+
[](https://beefy.github.io/quantum-simulator/)
|
|
56
|
+
[](https://pypi.org/project/quantum-simulator/)
|
|
57
|
+
[](http://unlicense.org/)
|
|
58
|
+
|
|
59
|
+
A Python library for simulating quantum computers and quantum algorithms. This package provides an easy-to-use interface for quantum state simulation, gate operations, and circuit execution.
|
|
60
|
+
|
|
61
|
+
## Features
|
|
62
|
+
|
|
63
|
+
- 🔬 **Quantum State Simulation**: Accurate simulation of quantum states using state vectors
|
|
64
|
+
- 🚪 **Quantum Gates**: Implementation of common single and multi-qubit gates (X, Y, Z, H, CNOT)
|
|
65
|
+
- 🔗 **Quantum Circuits**: Build and execute complex quantum circuits
|
|
66
|
+
- 📊 **Measurement**: Simulate quantum measurements with proper state collapse
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
### Installation
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install quantum-simulator
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Basic Example
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from quantum_simulator import QuantumSimulator, QuantumCircuit
|
|
80
|
+
from quantum_simulator.gates import H_GATE, CNOT_GATE
|
|
81
|
+
|
|
82
|
+
# Create a 2-qubit quantum simulator
|
|
83
|
+
sim = QuantumSimulator(2)
|
|
84
|
+
|
|
85
|
+
# Build a Bell state circuit
|
|
86
|
+
circuit = QuantumCircuit(2)
|
|
87
|
+
circuit.add_gate(H_GATE, [0]) # Hadamard on qubit 0
|
|
88
|
+
circuit.add_gate(CNOT_GATE, [0, 1]) # CNOT with control=0, target=1
|
|
89
|
+
|
|
90
|
+
# Execute the circuit
|
|
91
|
+
circuit.execute(sim)
|
|
92
|
+
|
|
93
|
+
# Measure the qubits
|
|
94
|
+
result0 = sim.measure(0)
|
|
95
|
+
result1 = sim.measure(1)
|
|
96
|
+
print(f"Measurement: {result0}, {result1}")
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Documentation
|
|
100
|
+
|
|
101
|
+
Full documentation is available at **[beefy.github.io/quantum-simulator](https://beefy.github.io/quantum-simulator/)**
|
|
102
|
+
|
|
103
|
+
- [Installation Guide](https://beefy.github.io/quantum-simulator/getting-started/installation/)
|
|
104
|
+
- [Quick Start](https://beefy.github.io/quantum-simulator/getting-started/quickstart/)
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
### Setting Up Development Environment
|
|
109
|
+
|
|
110
|
+
1. **Clone the repository**:
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://github.com/beefy/quantum-simulator.git
|
|
113
|
+
cd quantum-simulator
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
2. **Install in development mode**:
|
|
117
|
+
```bash
|
|
118
|
+
pip install -e .[dev,docs]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
3. **Run tests**:
|
|
122
|
+
```bash
|
|
123
|
+
pytest --cov=quantum_simulator --cov-report=xml --cov-report=term
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
4. **Run lint checks**:
|
|
127
|
+
```bash
|
|
128
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
129
|
+
mypy src/
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
4. **Build documentation**:
|
|
133
|
+
```bash
|
|
134
|
+
mkdocs serve
|
|
135
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Quantum Simulator
|
|
2
|
+
|
|
3
|
+
[](https://github.com/beefy/quantum-simulator/actions/workflows/tests.yml)
|
|
4
|
+
[](https://badge.fury.io/py/quantum-simulator)
|
|
5
|
+
[](https://beefy.github.io/quantum-simulator/)
|
|
6
|
+
[](https://pypi.org/project/quantum-simulator/)
|
|
7
|
+
[](http://unlicense.org/)
|
|
8
|
+
|
|
9
|
+
A Python library for simulating quantum computers and quantum algorithms. This package provides an easy-to-use interface for quantum state simulation, gate operations, and circuit execution.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- 🔬 **Quantum State Simulation**: Accurate simulation of quantum states using state vectors
|
|
14
|
+
- 🚪 **Quantum Gates**: Implementation of common single and multi-qubit gates (X, Y, Z, H, CNOT)
|
|
15
|
+
- 🔗 **Quantum Circuits**: Build and execute complex quantum circuits
|
|
16
|
+
- 📊 **Measurement**: Simulate quantum measurements with proper state collapse
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install quantum-simulator
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Basic Example
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from quantum_simulator import QuantumSimulator, QuantumCircuit
|
|
30
|
+
from quantum_simulator.gates import H_GATE, CNOT_GATE
|
|
31
|
+
|
|
32
|
+
# Create a 2-qubit quantum simulator
|
|
33
|
+
sim = QuantumSimulator(2)
|
|
34
|
+
|
|
35
|
+
# Build a Bell state circuit
|
|
36
|
+
circuit = QuantumCircuit(2)
|
|
37
|
+
circuit.add_gate(H_GATE, [0]) # Hadamard on qubit 0
|
|
38
|
+
circuit.add_gate(CNOT_GATE, [0, 1]) # CNOT with control=0, target=1
|
|
39
|
+
|
|
40
|
+
# Execute the circuit
|
|
41
|
+
circuit.execute(sim)
|
|
42
|
+
|
|
43
|
+
# Measure the qubits
|
|
44
|
+
result0 = sim.measure(0)
|
|
45
|
+
result1 = sim.measure(1)
|
|
46
|
+
print(f"Measurement: {result0}, {result1}")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
Full documentation is available at **[beefy.github.io/quantum-simulator](https://beefy.github.io/quantum-simulator/)**
|
|
52
|
+
|
|
53
|
+
- [Installation Guide](https://beefy.github.io/quantum-simulator/getting-started/installation/)
|
|
54
|
+
- [Quick Start](https://beefy.github.io/quantum-simulator/getting-started/quickstart/)
|
|
55
|
+
|
|
56
|
+
## Development
|
|
57
|
+
|
|
58
|
+
### Setting Up Development Environment
|
|
59
|
+
|
|
60
|
+
1. **Clone the repository**:
|
|
61
|
+
```bash
|
|
62
|
+
git clone https://github.com/beefy/quantum-simulator.git
|
|
63
|
+
cd quantum-simulator
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. **Install in development mode**:
|
|
67
|
+
```bash
|
|
68
|
+
pip install -e .[dev,docs]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
3. **Run tests**:
|
|
72
|
+
```bash
|
|
73
|
+
pytest --cov=quantum_simulator --cov-report=xml --cov-report=term
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
4. **Run lint checks**:
|
|
77
|
+
```bash
|
|
78
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
79
|
+
mypy src/
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
4. **Build documentation**:
|
|
83
|
+
```bash
|
|
84
|
+
mkdocs serve
|
|
85
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.5] - 2026-01-01
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Documentation fixes
|
|
12
|
+
|
|
13
|
+
## [0.1.4] - 2025-12-16
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Fix broken links in documentation
|
|
17
|
+
- Added initial math overview documentation
|
|
18
|
+
|
|
19
|
+
## [0.1.3] - 2025-12-16
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- Fix documentation references
|
|
23
|
+
|
|
24
|
+
## [0.1.2] - 2025-12-16
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- Fix documentation
|
|
28
|
+
- Fix docs github action
|
|
29
|
+
|
|
30
|
+
## [0.1.1] - 2025-12-16
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- Fix dimension mismatch bug
|
|
34
|
+
- Fix CNOT bug
|
|
35
|
+
- Fix documentation
|
|
36
|
+
- Add CONTRIBUTING.md
|
|
37
|
+
- Fix tests
|
|
38
|
+
- Fix linting
|
|
39
|
+
|
|
40
|
+
## [0.1.0] - 2025-12-16
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Initial release
|
|
44
|
+
- Initial project structure
|
|
45
|
+
- Basic quantum simulation functionality
|
|
46
|
+
- Documentation with MkDocs
|
|
47
|
+
- CI/CD with GitHub Actions
|
|
48
|
+
- `QuantumSimulator` class for quantum state simulation
|
|
49
|
+
- Basic quantum gates (X, Y, Z, H, CNOT)
|
|
50
|
+
- `QuantumCircuit` class for building quantum circuits
|
|
51
|
+
- Quantum measurement functionality
|
|
52
|
+
- Comprehensive documentation
|
|
53
|
+
- Unit tests and type checking
|
|
54
|
+
- PyPI packaging configuration
|
|
55
|
+
- GitHub Actions for automated testing and publishing
|
|
56
|
+
|
|
57
|
+
### Features
|
|
58
|
+
- Support for multi-qubit quantum systems
|
|
59
|
+
- State vector representation of quantum states
|
|
60
|
+
- Gate application and circuit execution
|
|
61
|
+
- Measurement with state collapse
|
|
62
|
+
- Modern Python packaging with `pyproject.toml`
|
|
63
|
+
- MkDocs documentation with Material theme
|
|
64
|
+
- Automated PyPI publishing on releases
|
|
65
|
+
- Automated documentation deployment to GitHub Pages
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
## Contributing
|
|
2
|
+
|
|
3
|
+
We welcome contributions! Please see our [Contributing Guide](https://beefy.github.io/quantum-simulator/development/contributing/) for details.
|
|
4
|
+
|
|
5
|
+
### Development Workflow
|
|
6
|
+
|
|
7
|
+
1. **Fork** the repository
|
|
8
|
+
2. **Create a feature branch**: `git checkout -b feature-name`
|
|
9
|
+
3. **Make changes** and add tests
|
|
10
|
+
4. **Run tests**: `pytest`
|
|
11
|
+
5. **Submit a pull request**
|
|
12
|
+
|
|
13
|
+
### Code Quality
|
|
14
|
+
|
|
15
|
+
We use several tools to maintain code quality:
|
|
16
|
+
|
|
17
|
+
- **pytest**: Testing framework
|
|
18
|
+
- **black**: Code formatting
|
|
19
|
+
- **flake8**: Linting
|
|
20
|
+
- **mypy**: Type checking
|
|
21
|
+
- **pre-commit**: Git hooks
|
|
22
|
+
|
|
23
|
+
## Requirements
|
|
24
|
+
|
|
25
|
+
- **Python**: 3.8 or higher
|
|
26
|
+
- **NumPy**: 1.20.0 or higher
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
This project is licensed under the Unlicense - see the [LICENSE](LICENSE) file for details.
|
|
31
|
+
|
|
32
|
+
## Links
|
|
33
|
+
|
|
34
|
+
- **PyPI Package**: [pypi.org/project/quantum-simulator](https://pypi.org/project/quantum-simulator/)
|
|
35
|
+
- **Documentation**: [beefy.github.io/quantum-simulator](https://beefy.github.io/quantum-simulator/)
|
|
36
|
+
- **Source Code**: [github.com/beefy/quantum-simulator](https://github.com/beefy/quantum-simulator)
|
|
37
|
+
- **Issue Tracker**: [github.com/beefy/quantum-simulator/issues](https://github.com/beefy/quantum-simulator/issues)
|