pythum
Simple minimalist quantum computing simalation for python
import pythum
Usage
Qubit
Class for qubit manipulation and instanciation by notation
from pythum import Qubit
qubit = Qubit()
|0>
Public Methods
Qubit.from_notation(cls, value: str) -> 'Qubit'
Instanciate a qubit by the formal notation.
The following are possible values:
- "|0>": 0
- "|1>": 1
- "|10>", "|01>": super position
from pythum import Qubit
qubit1 = Qubit.from_notation("|0>") # 0
qubit2 = Qubit.from_notation("|1>") # 1
qubit3 = Qubit.from_notation("|10>") # Super position
|0> |1> |01>
Qubit.from_qubit(cls, qubit: 'Qubit') -> 'Qubit'
Instanciate a copy of another qubit.
from pythum import Qubit
qubit1 = Qubit.from_notation("|1>") # 1
qubit2 = Qubit.from_qubit(qubit1) # 1
|1> |1>
up(self) -> 'self'
Points up the eletron.
The outcome of any measure will always be 1
from pythum import Qubit
qubit = Qubit() # 0
qubit.up() # 1
|1>
down(self) -> 'self'
Points down the eletron.
The outcome of any measure will always be 0
from pythum import Qubit
qubit = Qubit() # 0
qubit.up() # 1
|0>
left(self) -> 'self'
Points the eletronto the left.
The outcome of a measure may be 0 or 1
from pythum import Qubit
qubit = Qubit().left() # Super position
|01>
right(self) -> 'self'
Points the eletronto the right.
The outcome of a measure may be 0 or 1
from pythum import Qubit
qubit = Qubit().left() # Super position
|01>
Properties
alpha
Alpha probability for mesuring 0.
The returned probability is a number between 0 and 1.
from pythum import Qubit
Qubit().alpha
Qubit().up().alpha
Qubit().left().alpha
Qubit().right().alpha
1 0 0.5 0.5
beta
Beta probability for mesuring 1
The returned probability is a number between 0 and 1.
from pythum import Qubit
Qubit().beta
Qubit().up().beta
Qubit().left().beta
Qubit().right().beta
0 1 0.5 0.5
Qublock
Public methods
init(self, value: Union[int, 'Qublock', List[Qubit]])
Metadata
Release files for pythum 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pythum-0.1.1.tar.gz | 3.4 kB | Without provenance | Details for pythum-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pythum-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pythum-0.1.1-py3-none-any.whl |
Total release size: 8.4 kB
Release files / pythum-0.1.1.tar.gz
| Download URL | pythum-0.1.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ae0bde3a3802be9ec480641bbe35341cdc527d9e1b2b99e14de62bb7e61487b
|
|
BLAKE2b-256 checksum How to use checksums |
0cc3680eadbf6802f0a943c54c0ee4d5c23902ce7f227677a28acff6f3d36124
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4
|
Release files / pythum-0.1.1-py3-none-any.whl
| Download URL | pythum-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bd30b220dcf50b52105ac3bab7edbfe4a6f67a8cf5f78b30e379fccf7fe17bb
|
|
BLAKE2b-256 checksum How to use checksums |
062fc139b0ba7ed61c38946ccc9e005b059438beb29fdc33a4b90e3c2fd37d1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4
|
Security for pythum 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.