oqubit 0.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.
oqubit-0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Priyam Ghosh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
oqubit-0.1/PKG-INFO ADDED
@@ -0,0 +1,489 @@
1
+ Metadata-Version: 2.4
2
+ Name: oqubit
3
+ Version: 0.1
4
+ Requires-Python: >=3.9
5
+ Description-Content-Type: text/markdown
6
+ License-File: LICENSE
7
+ Requires-Dist: numpy>=2.0
8
+ Dynamic: description
9
+ Dynamic: description-content-type
10
+ Dynamic: license-file
11
+ Dynamic: requires-dist
12
+ Dynamic: requires-python
13
+
14
+ # OQubit
15
+
16
+ ## **OQubit** is an open-source quantum computing simulator written in Python.
17
+
18
+ It provides a clean, extensible framework for representing qubits, state vectors, quantum gates, circuits, measurements, and quantum algorithms. OQubit is designed for **quantum computing education, experimentation, algorithm development, and research-oriented software development**.
19
+
20
+ > **OQubit is currently under active development. APIs may change between releases.**
21
+
22
+ ---
23
+
24
+ ## Features
25
+
26
+ * Qubit state representation
27
+ * State-vector simulation
28
+ * Single-qubit quantum gates
29
+ * Controlled and multi-qubit gates
30
+ * Quantum circuits
31
+ * Measurement and sampling
32
+ * Quantum algorithms
33
+ * Jupyter Notebook examples
34
+ * Unit tests and benchmarks
35
+
36
+ ### Algorithms
37
+
38
+ OQubit currently provides implementations of several fundamental quantum algorithms, including:
39
+
40
+ * Deutsch algorithm
41
+ * Deutsch–Jozsa algorithm
42
+ * Bernstein–Vazirani algorithm
43
+ * Superdense Coding
44
+
45
+ More algorithms are being added as the project develops.
46
+
47
+ ---
48
+
49
+ ## Installation
50
+
51
+ Install the latest released version from PyPI:
52
+
53
+ ```bash
54
+ pip install oqubit
55
+ ```
56
+
57
+ For development, clone the repository:
58
+
59
+ ```bash
60
+ git clone https://github.com/priyamghosh2009/OQubit.git
61
+ cd OQubit
62
+ ```
63
+
64
+ Create a virtual environment:
65
+
66
+ ```bash
67
+ python -m venv .venv
68
+ ```
69
+
70
+ Activate it on Windows:
71
+
72
+ ```powershell
73
+ .venv\Scripts\Activate.ps1
74
+ ```
75
+
76
+ Or on Linux/macOS:
77
+
78
+ ```bash
79
+ source .venv/bin/activate
80
+ ```
81
+
82
+ Install the project:
83
+
84
+ ```bash
85
+ pip install -e .
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Quick Start
91
+
92
+ ### Create a qubit
93
+
94
+ ```python
95
+ from oqubit import Qubit
96
+
97
+ q = Qubit(0,1,normalize=True)
98
+
99
+ print(q)
100
+ ```
101
+
102
+ The default qubit represents the computational basis state:
103
+
104
+ $$
105
+ |0\rangle =
106
+ \begin{bmatrix}
107
+ 1 \\
108
+ 0
109
+ \end{bmatrix}
110
+ $$
111
+
112
+ A qubit can also be initialized using complex amplitudes:
113
+
114
+ ```python
115
+ from oqubit import Qubit
116
+
117
+ q = Qubit(
118
+ alpha=1 / 2**0.5,
119
+ beta=1 / 2**0.5
120
+ )
121
+
122
+ print(q.state)
123
+ ```
124
+
125
+ This represents the state:
126
+
127
+ $$
128
+ |\psi\rangle =
129
+ \frac{1}{\sqrt{2}}|0\rangle +
130
+ \frac{1}{\sqrt{2}}|1\rangle
131
+ $$
132
+
133
+ ---
134
+
135
+ ## State Vectors
136
+
137
+ Multiple qubits can be combined into a state vector.
138
+
139
+ ```python
140
+ from oqubit import Qubit, StateVector
141
+
142
+ q0 = Qubit.zero()
143
+ q1 = Qubit.zero()
144
+
145
+ state = StateVector([q0, q1])
146
+
147
+ print(state)
148
+ ```
149
+
150
+ The resulting system represents:
151
+
152
+ $$
153
+ |00\rangle
154
+ $$
155
+
156
+ OQubit uses tensor products to construct multi-qubit state vectors.
157
+
158
+ ---
159
+
160
+ ## Quantum Gates
161
+
162
+ OQubit provides standard quantum gates such as:
163
+
164
+ * X
165
+ * Y
166
+ * Z
167
+ * H
168
+ * S
169
+ * T
170
+ * Controlled-X
171
+ * Controlled-Z
172
+ * SWAP
173
+ * and other gates supported by the library
174
+
175
+ Example:
176
+
177
+ ```python
178
+ from oqubit import Qubit, StateVector
179
+ from oqubit import H, X
180
+
181
+ q = Qubit.zero()
182
+
183
+ state = StateVector([q])
184
+
185
+ state.apply(H,targets=0)
186
+
187
+ print(state)
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Quantum Circuits
193
+
194
+ Quantum circuits provide a higher-level interface for composing operations.
195
+
196
+ ```python
197
+ import oqubit
198
+
199
+ circuit = oqubit.Circuit(2)
200
+
201
+ circuit.h(0)
202
+ circuit.cx(0, 1)
203
+
204
+ print(circuit)
205
+ ```
206
+
207
+ The circuit represents a Bell-state preparation circuit:
208
+
209
+ $$
210
+ |00\rangle
211
+ \xrightarrow{H_0}
212
+ \frac{|00\rangle + |10\rangle}{\sqrt{2}}
213
+ \xrightarrow{CX}
214
+ \frac{|00\rangle + |11\rangle}{\sqrt{2}}
215
+ $$
216
+
217
+ ---
218
+
219
+ ## Measurement
220
+
221
+ Quantum states can be measured using OQubit's measurement API.
222
+
223
+ ```python
224
+ from oqubit import measure,Qubit,StateVector
225
+ q = Qubit.zero()
226
+ state = StateVector([q])
227
+ result = measure(state)
228
+ print(result)
229
+ ```
230
+
231
+ Repeated measurements can be simulated through sampling:
232
+
233
+ ```python
234
+ from oqubit import sample
235
+ from oqubit import ,Qubit,StateVector
236
+ q = Qubit.zero()
237
+ state = StateVector([q])
238
+ results = sample(state, shots=1000)
239
+
240
+ print(results)
241
+ ```
242
+
243
+ ---
244
+
245
+ ## Algorithms
246
+
247
+ OQubit provides an algorithms package:
248
+
249
+ ```python
250
+ from oqubit.algorithms import deutsch
251
+ ```
252
+
253
+ For example:
254
+
255
+ ```python
256
+ def sq(x):
257
+ return x**2
258
+ result = deutsch(sq)
259
+ print(result)
260
+ ```
261
+
262
+ Algorithm implementations are built using OQubit's circuit and state-vector APIs rather than being independent simulation systems.
263
+
264
+ This keeps the algorithms closely connected to the core simulator architecture.
265
+
266
+ ---
267
+
268
+ ## Project Structure
269
+
270
+ ```text
271
+ OQubit/
272
+ │
273
+ ├── src/
274
+ │ └── oqubit/
275
+ │ ├── algorithms/
276
+ │ ├── circuit/
277
+ │ ├── core/
278
+ │ ├── gates/
279
+ │ ├── measurement/
280
+ │ └── __init__.py
281
+ │
282
+ ├── tests/
283
+ │
284
+ ├── benchmarks/
285
+ │
286
+ ├── examples/
287
+ │
288
+ ├── docs/
289
+ │
290
+ ├── scripts/
291
+ │
292
+ ├── CITATION.cff
293
+ ├── pyproject.toml
294
+ ├── CODE_OF_CONDUCT.md
295
+ ├── CONTRIBUTING.md
296
+ ├── SECURITY.md
297
+ ├── LICENSE
298
+ ├── README.md
299
+ └── setup.py
300
+ ```
301
+
302
+ ---
303
+
304
+ ## Development
305
+
306
+ Install the development dependencies:
307
+
308
+ ```bash
309
+ pip install -e .
310
+ pip install pytest
311
+ ```
312
+
313
+ Run the test suite:
314
+
315
+ ```bash
316
+ pytest -v
317
+ ```
318
+
319
+ Run a specific test:
320
+
321
+ ```bash
322
+ pytest -v tests/test_qubit.py
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Examples
328
+
329
+ The `examples/` directory contains executable examples and Jupyter notebooks demonstrating OQubit.
330
+
331
+ Examples include:
332
+
333
+ ```text
334
+ examples/
335
+ ├── 01_qubit.ipynb
336
+ ├── 02_statevector.ipynb
337
+ ├── 03_gates.ipynb
338
+ ├── 04_circuit.ipynb
339
+ ├── ...
340
+ ├── 08_deutsch.ipynb
341
+ ├── 09_deutsch_jozsa.ipynb
342
+ ├── 10_bernstein_vazirani.ipynb
343
+ └── 11_superdense_coding.ipynb
344
+ ```
345
+
346
+ The notebooks are intended to make the underlying quantum operations transparent rather than hiding the simulation behind a high-level interface.
347
+
348
+ ---
349
+
350
+ ## Architecture
351
+
352
+ OQubit is organized into several layers.
353
+
354
+ ### Core
355
+
356
+ The core layer contains fundamental quantum representations:
357
+
358
+ ```text
359
+ core/
360
+ ├── qubit.py
361
+ ├── statevector.py
362
+ └── operators.py
363
+ ```
364
+
365
+ ### Gates
366
+
367
+ The gates layer contains quantum gate definitions:
368
+
369
+ ```text
370
+ gates/
371
+ ├── single.py
372
+ ├── controlled.py
373
+ └── multi.py
374
+ ```
375
+
376
+ ### Circuits
377
+
378
+ The circuit layer represents sequences of quantum instructions:
379
+
380
+ ```text
381
+ circuit/
382
+ ├── circuit.py
383
+ └── instruction.py
384
+ ```
385
+
386
+ ### Measurement
387
+
388
+ Measurement and statistical sampling are separated from state representation:
389
+
390
+ ```text
391
+ measurement/
392
+ ├── measurement.py
393
+ └── sampling.py
394
+ ```
395
+
396
+ ### Algorithms
397
+
398
+ Higher-level quantum algorithms are implemented using the simulator:
399
+
400
+ ```text
401
+ algorithms/
402
+ ├── deutsch.py
403
+ ├── deutsch_jozsa.py
404
+ ├── bernstein_vazirani.py
405
+ └── superdense_coding.py
406
+ ```
407
+
408
+ This separation is intended to keep the simulator modular and make future backend development easier.
409
+
410
+ ---
411
+ ## Testing and Benchmarks
412
+
413
+ OQubit uses automated tests to validate its core components.
414
+
415
+ The project also contains benchmarks for measuring the performance of operations such as:
416
+
417
+ * Qubit creation
418
+ * State-vector construction
419
+ * Quantum gates
420
+ * Circuit execution
421
+ * Quantum algorithms
422
+
423
+ Performance results should be interpreted in the context of simulator configuration, Python version, hardware, and circuit size.
424
+
425
+ ---
426
+
427
+ ## Contributing
428
+
429
+ Contributions are welcome.
430
+
431
+ Before contributing, please read:
432
+
433
+ * `CONTRIBUTING.md`
434
+ * `CODE_OF_CONDUCT.md`
435
+ * `SECURITY.md`
436
+
437
+ For bugs, feature requests, documentation improvements, or other development discussions, use the appropriate GitHub repository channels.
438
+
439
+ ---
440
+
441
+ ## Security
442
+
443
+ Please do not publicly disclose security-sensitive issues before they have been responsibly reported.
444
+
445
+ See `SECURITY.md` for the project's security reporting process.
446
+
447
+ ---
448
+
449
+ ## Citation
450
+
451
+ If you use OQubit in research, education, software, or other work, please cite the project.
452
+
453
+ Citation information is provided in:
454
+
455
+ ```text
456
+ CITATION.cff
457
+ ```
458
+
459
+ ---
460
+
461
+ ## License
462
+
463
+ OQubit is distributed under the license specified in:
464
+
465
+ ```text
466
+ LICENSE
467
+ ```
468
+
469
+ ---
470
+
471
+ ## Author
472
+
473
+ **Priyam Ghosh**
474
+
475
+ GitHub: `priyamghosh2009`
476
+
477
+ ORCID: `0009-0006-8619-349X`
478
+
479
+ ---
480
+
481
+ ## Status
482
+
483
+ OQubit is an **open-source quantum computing simulator under active development**.
484
+
485
+ The project focuses on building a transparent and extensible simulation stack in Python, with future work exploring higher-performance native backends.
486
+
487
+ ---
488
+
489
+ **OQubit — Quantum computing, simulated.**