Skip to main content

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]])

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)

Source distribution for pythum 0.1.1
File Size Uploaded
pythum-0.1.1.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pythum 0.1.1
File Interpreter ABI Platform
pythum-0.1.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page