PyQrackIsing 9.3.0__tar.gz → 9.3.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.
Files changed (28) hide show
  1. {pyqrackising-9.3.0/pyqrackising.egg-info → pyqrackising-9.3.1}/PKG-INFO +1 -1
  2. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyproject.toml +1 -1
  3. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/otoc.py +13 -11
  4. {pyqrackising-9.3.0 → pyqrackising-9.3.1/pyqrackising.egg-info}/PKG-INFO +1 -1
  5. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/setup.py +1 -1
  6. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/LICENSE.md +0 -0
  7. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/MANIFEST.in +0 -0
  8. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/README.md +0 -0
  9. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/__init__.py +0 -0
  10. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/convert_tensor_network_to_tsp.py +0 -0
  11. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/generate_tfim_samples.py +0 -0
  12. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/kernels.cl +0 -0
  13. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/maxcut_tfim.py +0 -0
  14. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/maxcut_tfim_sparse.py +0 -0
  15. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/maxcut_tfim_streaming.py +0 -0
  16. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/maxcut_tfim_util.py +0 -0
  17. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/spin_glass_solver.py +0 -0
  18. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/spin_glass_solver_sparse.py +0 -0
  19. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/spin_glass_solver_streaming.py +0 -0
  20. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/tfim_magnetization.py +0 -0
  21. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/tfim_square_magnetization.py +0 -0
  22. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/tsp.py +0 -0
  23. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising/tsp_maxcut.py +0 -0
  24. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising.egg-info/SOURCES.txt +0 -0
  25. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising.egg-info/dependency_links.txt +0 -0
  26. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising.egg-info/not-zip-safe +0 -0
  27. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/pyqrackising.egg-info/top_level.txt +0 -0
  28. {pyqrackising-9.3.0 → pyqrackising-9.3.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.3.0
3
+ Version: 9.3.1
4
4
  Summary: Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
10
10
 
11
11
  [project]
12
12
  name = "pyqrackising"
13
- version = "9.3.0"
13
+ version = "9.3.1"
14
14
  requires-python = ">=3.8"
15
15
  description = "Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)"
16
16
  readme = {file = "README.txt", content-type = "text/markdown"}
@@ -9,13 +9,13 @@ def get_otoc_hamming_distribution(J=-1.0, h=2.0, z=4, theta=0.174532925199432957
9
9
  if len(pauli_string) != n_qubits:
10
10
  raise ValueError("OTOCS pauli_string must be same length as n_qubits! (Use 'I' for qubits that aren't changed.)")
11
11
 
12
- fwd = probability_by_hamming_weight(J, h, z, theta, t, n_qubits + 1, False)
13
- rev = probability_by_hamming_weight(-J, -h, z, -theta, t, n_qubits + 1, False)
12
+ fwd = probability_by_hamming_weight(J, h, z, theta, t, n_qubits + 1)
13
+ rev = probability_by_hamming_weight(-J, -h, z, -theta, t, n_qubits + 1)
14
14
  diff_theta = rev - fwd
15
15
 
16
16
  phi = theta - np.pi / 2
17
- fwd = probability_by_hamming_weight(J, h, z, phi, t, n_qubits + 1, False)
18
- rev = probability_by_hamming_weight(-J, -h, z, -phi, t, n_qubits + 1, False)
17
+ fwd = probability_by_hamming_weight(J, h, z, phi, t, n_qubits + 1)
18
+ rev = probability_by_hamming_weight(-J, -h, z, -phi, t, n_qubits + 1)
19
19
  diff_phi = rev - fwd
20
20
 
21
21
  diff_theta *= cycles
@@ -97,26 +97,26 @@ def generate_otoc_samples(J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n
97
97
 
98
98
  measurement_basis = list(measurement_basis)
99
99
  if len(measurement_basis) != n_qubits:
100
- raise ValueError("OTOC measurement_basis must be same length as measurement_basis! (Use 'I' for excluded qubits.)")
100
+ raise ValueError("OTOC measurement_basis must be same length as n_qubits! (Use 'I' for excluded qubits.)")
101
101
 
102
102
  basis_x, basis_y, basis_z = [], [], []
103
103
  for b in pauli_string:
104
104
  if b == 'Z':
105
105
  basis_z.append('X')
106
- basis_y.append('Z')
107
- basis_x.append('I')
106
+ basis_y.append('I')
107
+ basis_x.append('Z')
108
108
  elif b == 'X':
109
109
  basis_z.append('Z')
110
110
  basis_y.append('I')
111
111
  basis_x.append('X')
112
112
  elif b == 'Y':
113
113
  basis_z.append('I')
114
- basis_y.append('I')
115
- basis_x.append('X')
114
+ basis_y.append('Z')
115
+ basis_x.append('I')
116
116
  else:
117
117
  basis_z.append('I')
118
- basis_y.append('X')
119
- basis_x.append('Z')
118
+ basis_y.append('I')
119
+ basis_x.append('I')
120
120
 
121
121
  bases = { 'X': basis_x, 'Y': basis_y, 'Z': basis_z }
122
122
  thresholds = { key: fix_cdf(value) for key, value in get_otoc_hamming_distribution(J, h, z, theta, t, n_qubits, cycles, pauli_string).items() }
@@ -133,6 +133,8 @@ def generate_otoc_samples(J=-1.0, h=2.0, z=4, theta=0.174532925199432957, t=5, n
133
133
 
134
134
  # First dimension: Hamming weight
135
135
  m = sample_mag(value)
136
+ if m == 0:
137
+ continue
136
138
  if m >= n_qubits:
137
139
  sample_3_axis[key] = (1 << n_qubits) - 1
138
140
  continue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrackising
3
- Version: 9.3.0
3
+ Version: 9.3.1
4
4
  Summary: Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)
5
5
  Home-page: https://github.com/vm6502q/PyQrackIsing
6
6
  Author: Dan Strano
@@ -7,7 +7,7 @@ with open(README_PATH) as readme_file:
7
7
 
8
8
  setup(
9
9
  name='pyqrackising',
10
- version='9.3.0',
10
+ version='9.3.1',
11
11
  author='Dan Strano',
12
12
  author_email='stranoj@gmail.com',
13
13
  description='Fast MAXCUT, TSP, and sampling heuristics from near-ideal transverse field Ising model (TFIM)',
File without changes
File without changes
File without changes
File without changes