python-qis 1.2.0__tar.gz → 1.2.2__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.
- python_qis-1.2.2/PKG-INFO +95 -0
- python_qis-1.2.2/README.md +86 -0
- {python_qis-1.2.0 → python_qis-1.2.2}/pyproject.toml +1 -1
- {python_qis-1.2.0 → python_qis-1.2.2}/pyproject.toml.orig +1 -1
- {python_qis-1.2.0 → python_qis-1.2.2}/src/python_qis/__init__.py +9 -1
- python_qis-1.2.0/PKG-INFO +0 -21
- python_qis-1.2.0/README.md +0 -12
- {python_qis-1.2.0 → python_qis-1.2.2}/src/python_qis/cryptography_tools.py +0 -0
- {python_qis-1.2.0 → python_qis-1.2.2}/src/python_qis/math/general.py +0 -0
- {python_qis-1.2.0 → python_qis-1.2.2}/src/python_qis/math/qis.py +0 -0
- {python_qis-1.2.0 → python_qis-1.2.2}/src/python_qis/physics_tools.py +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: python-qis
|
|
3
|
+
Version: 1.2.2
|
|
4
|
+
Summary: QIS Library for Python. (QIS is Quantum Information Science)
|
|
5
|
+
Author: Vedansh Shetti
|
|
6
|
+
Author-email: Vedansh Shetti <vedansh.shetti@gmail.com>
|
|
7
|
+
Requires-Python: >=3.13
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# python-qis
|
|
11
|
+
|
|
12
|
+
Small Python utilities for mathematics, quantum information science, cryptography,
|
|
13
|
+
and introductory physics.
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- Python 3.13 or newer
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Install the latest release from PyPI with pip:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python -m pip install python-qis
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or add it to a project managed with uv:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
uv add python-qis
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
### Cryptography
|
|
36
|
+
|
|
37
|
+
Hash functions accept bytes and return hexadecimal strings:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from python_qis.cryptography_tools import blake2, sha3
|
|
41
|
+
|
|
42
|
+
message = b"hello, QIS world"
|
|
43
|
+
|
|
44
|
+
print(blake2("b", message))
|
|
45
|
+
print(sha3("256", message))
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Math and quantum states
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from python_qis import general_math, qis_math
|
|
52
|
+
|
|
53
|
+
print(general_math.add(2, 3, 5))
|
|
54
|
+
print(general_math.pi(12))
|
|
55
|
+
|
|
56
|
+
state = qis_math.buildVector(1 / 2**0.5, 1 / 2**0.5)
|
|
57
|
+
print(qis_math.is_normalized([value[0] for value in state]))
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Physics constants and standard states
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from python_qis import physics_constants
|
|
64
|
+
from python_qis.physics_tools import BELL_PHI_PLUS, KET_0, KET_1, KET_PLUS
|
|
65
|
+
|
|
66
|
+
print(physics_constants["SPEED_OF_LIGHT"])
|
|
67
|
+
print(KET_0, KET_1, KET_PLUS, BELL_PHI_PLUS)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## What's included?
|
|
71
|
+
|
|
72
|
+
- **Math utilities:** arithmetic helpers, factorials, and decimal digits of pi.
|
|
73
|
+
- **Quantum information utilities:** vector construction and normalization checks.
|
|
74
|
+
- **Cryptography utilities:** BLAKE2 and SHA-3 hashing through Python's standard library.
|
|
75
|
+
- **Physics utilities:** selected SI constants and common qubit states.
|
|
76
|
+
|
|
77
|
+
## Development
|
|
78
|
+
|
|
79
|
+
Clone the repository and install it in an editable environment:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git clone https://github.com/VedanshShetti/python-qis.git
|
|
83
|
+
cd python-qis
|
|
84
|
+
uv sync
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Build the package with:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
uv build
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is licensed under the terms in [LICENSE](LICENSE).
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# python-qis
|
|
2
|
+
|
|
3
|
+
Small Python utilities for mathematics, quantum information science, cryptography,
|
|
4
|
+
and introductory physics.
|
|
5
|
+
|
|
6
|
+
## Requirements
|
|
7
|
+
|
|
8
|
+
- Python 3.13 or newer
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
Install the latest release from PyPI with pip:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
python -m pip install python-qis
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or add it to a project managed with uv:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
uv add python-qis
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
25
|
+
|
|
26
|
+
### Cryptography
|
|
27
|
+
|
|
28
|
+
Hash functions accept bytes and return hexadecimal strings:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from python_qis.cryptography_tools import blake2, sha3
|
|
32
|
+
|
|
33
|
+
message = b"hello, QIS world"
|
|
34
|
+
|
|
35
|
+
print(blake2("b", message))
|
|
36
|
+
print(sha3("256", message))
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Math and quantum states
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from python_qis import general_math, qis_math
|
|
43
|
+
|
|
44
|
+
print(general_math.add(2, 3, 5))
|
|
45
|
+
print(general_math.pi(12))
|
|
46
|
+
|
|
47
|
+
state = qis_math.buildVector(1 / 2**0.5, 1 / 2**0.5)
|
|
48
|
+
print(qis_math.is_normalized([value[0] for value in state]))
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Physics constants and standard states
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from python_qis import physics_constants
|
|
55
|
+
from python_qis.physics_tools import BELL_PHI_PLUS, KET_0, KET_1, KET_PLUS
|
|
56
|
+
|
|
57
|
+
print(physics_constants["SPEED_OF_LIGHT"])
|
|
58
|
+
print(KET_0, KET_1, KET_PLUS, BELL_PHI_PLUS)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## What's included?
|
|
62
|
+
|
|
63
|
+
- **Math utilities:** arithmetic helpers, factorials, and decimal digits of pi.
|
|
64
|
+
- **Quantum information utilities:** vector construction and normalization checks.
|
|
65
|
+
- **Cryptography utilities:** BLAKE2 and SHA-3 hashing through Python's standard library.
|
|
66
|
+
- **Physics utilities:** selected SI constants and common qubit states.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
Clone the repository and install it in an editable environment:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/VedanshShetti/python-qis.git
|
|
74
|
+
cd python-qis
|
|
75
|
+
uv sync
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Build the package with:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
uv build
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
This project is licensed under the terms in [LICENSE](LICENSE).
|
|
@@ -2,8 +2,16 @@ import python_qis.math.general as general_math
|
|
|
2
2
|
import python_qis.math.qis as qis_math
|
|
3
3
|
import python_qis.cryptography_tools as cryptography_tools
|
|
4
4
|
import python_qis.physics_tools as physics_tools
|
|
5
|
+
from typing import Literal
|
|
5
6
|
|
|
6
|
-
physics_constants: dict[
|
|
7
|
+
physics_constants: dict[
|
|
8
|
+
Literal[
|
|
9
|
+
"H_JOULE_SEC",
|
|
10
|
+
"HBAR_JOULE_SEC",
|
|
11
|
+
"BOLTZMANN_CONSTANT",
|
|
12
|
+
"SPEED_OF_LIGHT",
|
|
13
|
+
"ELEMENTARY_CHARGE"
|
|
14
|
+
], complex | float] = {
|
|
7
15
|
"H_JOULE_SEC": physics_tools.H_JOULE_SEC,
|
|
8
16
|
"HBAR_JOULE_SEC": physics_tools.HBAR_JOULE_SEC,
|
|
9
17
|
"BOLTZMANN_CONSTANT": physics_tools.BOLTZMANN_CONSTANT,
|
python_qis-1.2.0/PKG-INFO
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: python-qis
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: QIS Library for Python. (QIS is Quantum Information Science)
|
|
5
|
-
Author: Vedansh Shetti
|
|
6
|
-
Author-email: Vedansh Shetti <vedansh.shetti@gmail.com>
|
|
7
|
-
Requires-Python: >=3.13
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
|
|
10
|
-
# python-qis
|
|
11
|
-
QIS Library for Python. (QIS is Quantum Information Science)
|
|
12
|
-
|
|
13
|
-
## What do I get?
|
|
14
|
-
- Math Utilities
|
|
15
|
-
- Cryptography Utilities (SHA, SHA_3, BLAKE, MD5 and such)
|
|
16
|
-
- Basic Physics Utilities (I'm working on this, please don't get mad if I mess up something here, we just started 7th grade, Physics is new to me)
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
19
|
-
`pip install python-qis`
|
|
20
|
-
OR if using `uv`:
|
|
21
|
-
`uv install python-qis`
|
python_qis-1.2.0/README.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# python-qis
|
|
2
|
-
QIS Library for Python. (QIS is Quantum Information Science)
|
|
3
|
-
|
|
4
|
-
## What do I get?
|
|
5
|
-
- Math Utilities
|
|
6
|
-
- Cryptography Utilities (SHA, SHA_3, BLAKE, MD5 and such)
|
|
7
|
-
- Basic Physics Utilities (I'm working on this, please don't get mad if I mess up something here, we just started 7th grade, Physics is new to me)
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
`pip install python-qis`
|
|
11
|
-
OR if using `uv`:
|
|
12
|
-
`uv install python-qis`
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|