python-qis 1.0.1__tar.gz → 1.2.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: python-qis
3
- Version: 1.0.1
3
+ Version: 1.2.0
4
4
  Summary: QIS Library for Python. (QIS is Quantum Information Science)
5
5
  Author: Vedansh Shetti
6
6
  Author-email: Vedansh Shetti <vedansh.shetti@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-qis"
3
- version = "1.0.1"
3
+ version = "1.2.0"
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.0.1"
3
+ version = "1.2.0"
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
@@ -0,0 +1,15 @@
1
+ import math
2
+ from .math.qis import buildVector
3
+
4
+ # Fundamental Constants (SI Units)
5
+ H_JOULE_SEC = 6.62607015e-34 # Planck constant
6
+ HBAR_JOULE_SEC = H_JOULE_SEC / (2 * math.pi) # Reduced Planck constant
7
+ SPEED_OF_LIGHT = 299_792_458 # m/s
8
+ BOLTZMANN_CONSTANT = 1.380649e-23 # Joules per Kelvin (J/K)
9
+ ELEMENTARY_CHARGE = 1.602176634e-19 # Coulombs (C)
10
+
11
+ # Standard States (Qubits)
12
+ KET_0 = buildVector(1, 0)
13
+ KET_1 = buildVector(0, 1)
14
+ KET_PLUS = buildVector(1/math.sqrt(2), 1/math.sqrt(2))
15
+ BELL_PHI_PLUS = buildVector(1/math.sqrt(2), 0, 0, 1/math.sqrt(2))
@@ -1,8 +0,0 @@
1
- import math
2
-
3
- # Fundamental Constants (SI Units)
4
- H_JOULE_SEC = 6.62607015e-34 # Planck constant
5
- HBAR_JOULE_SEC = H_JOULE_SEC / (2 * math.pi) # Reduced Planck constant
6
- SPEED_OF_LIGHT = 299_792_458 # m/s
7
- BOLTZMANN_CONSTANT = 1.380649e-23 # Joules per Kelvin (J/K)
8
- ELEMENTARY_CHARGE = 1.602176634e-19 # Coulombs (C)
File without changes