python-qis 1.1.0__tar.gz → 1.2.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.
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.3
2
+ Name: python-qis
3
+ Version: 1.2.1
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).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-qis"
3
- version = "1.1.0"
3
+ version = "1.2.1"
4
4
  description = "QIS Library for Python. (QIS is Quantum Information Science)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-qis"
3
- version = "1.1.0"
3
+ version = "1.2.1"
4
4
  description = "QIS Library for Python. (QIS is Quantum Information Science)"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -1,8 +1,8 @@
1
- import python_qis.math_tools as math_tools
1
+ import python_qis.math.general as general_math
2
+ import python_qis.math.qis as qis_math
2
3
  import python_qis.cryptography_tools as cryptography_tools
3
4
  import python_qis.physics_tools as physics_tools
4
5
 
5
- maths = math_tools
6
6
  physics_constants: dict[str, complex | float] = {
7
7
  "H_JOULE_SEC": physics_tools.H_JOULE_SEC,
8
8
  "HBAR_JOULE_SEC": physics_tools.HBAR_JOULE_SEC,
@@ -11,4 +11,4 @@ physics_constants: dict[str, complex | float] = {
11
11
  "ELEMENTARY_CHARGE": physics_tools.ELEMENTARY_CHARGE
12
12
  }
13
13
 
14
- __all__ = ["maths", "cryptography_tools", "physics_constants"] # Export Everything Here
14
+ __all__ = ["qis_math", "general_math", "cryptography_tools", "physics_constants"] # Export Everything Here
@@ -24,11 +24,3 @@ def factorial(n: int) -> int:
24
24
  else: return 1
25
25
  def pi(digits: int) -> Decimal: return Decimal(pi_string[0 : len(pi_string) if digits >= len(pi_string) else digits])
26
26
 
27
- def is_normalized(vector: list[complex])-> bool:
28
- absList: list[complex] = []
29
- for i in vector:
30
- absList.append(abs(0 - i))
31
- total = 0
32
- for i in absList:
33
- total+= exponentiation(i, 2)
34
- return True if abs(total - 1.0) < 1e-9 else False
@@ -0,0 +1,16 @@
1
+ from .general import exponentiation
2
+
3
+ def is_normalized(vector: list[complex])-> bool:
4
+ absList: list[complex] = []
5
+ for i in vector:
6
+ absList.append(abs(0 - i))
7
+ total = 0
8
+ for i in absList:
9
+ total+= exponentiation(i, 2)
10
+ return True if abs(total - 1.0) < 1e-9 else False
11
+
12
+ def buildVector(*args: complex)-> list[list[complex]]:
13
+ v: list[list[complex]] = []
14
+ for i in args:
15
+ v.append([i])
16
+ return v
@@ -1,10 +1,5 @@
1
1
  import math
2
-
3
- def buildVector(*args: complex)-> list[list[complex]]:
4
- v: list[list[complex]] = []
5
- for i in args:
6
- v.append([i])
7
- return v
2
+ from .math.qis import buildVector
8
3
 
9
4
  # Fundamental Constants (SI Units)
10
5
  H_JOULE_SEC = 6.62607015e-34 # Planck constant
python_qis-1.1.0/PKG-INFO DELETED
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: python-qis
3
- Version: 1.1.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`
@@ -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`