pyqrack-cuda 1.49.5__tar.gz → 1.49.6__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 (29) hide show
  1. {pyqrack_cuda-1.49.5/pyqrack_cuda.egg-info → pyqrack_cuda-1.49.6}/PKG-INFO +1 -1
  2. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_ace_backend.py +63 -4
  3. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
  4. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/setup.py +1 -1
  5. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/LICENSE +0 -0
  6. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/MANIFEST.in +0 -0
  7. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/Makefile +0 -0
  8. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/README.md +0 -0
  9. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyproject.toml +0 -0
  10. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.49.5 → pyqrack_cuda-1.49.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.49.5
3
+ Version: 1.49.6
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -19,6 +19,12 @@ try:
19
19
  except ImportError:
20
20
  _IS_QISKIT_AVAILABLE = False
21
21
 
22
+ _IS_QISKIT_AER_AVAILABLE = True
23
+ try:
24
+ from qiskit_aer.noise import NoiseModel, depolarizing_error
25
+ except ImportError:
26
+ _IS_QISKIT_AER_AVAILABLE = False
27
+
22
28
 
23
29
  class QrackAceBackend:
24
30
  """A back end for elided quantum error correction
@@ -62,11 +68,12 @@ class QrackAceBackend:
62
68
  self.alternating_codes = alternating_codes
63
69
  self.long_range_columns = long_range_columns
64
70
  self._is_init = [False] * qubit_count
71
+ self._coupling_map = None
65
72
 
66
73
  # If there's only one or zero "False" columns,
67
74
  # the entire simulator is connected, anyway.
68
75
  if (long_range_columns + 1) >= self.row_length:
69
- self._is_col_long_range = [True] * long_range_columns
76
+ self._is_col_long_range = [True] * self.row_length
70
77
  else:
71
78
  col_seq = [True] * long_range_columns + [False]
72
79
  len_col_seq = len(col_seq)
@@ -1093,7 +1100,10 @@ class QrackAceBackend:
1093
1100
 
1094
1101
  # Mostly written by Dan, but with a little help from Elara (custom OpenAI GPT)
1095
1102
  def get_logical_coupling_map(self):
1096
- coupling_map = set()
1103
+ if self._coupling_map:
1104
+ return self._coupling_map
1105
+
1106
+ coupling_map = []
1097
1107
  rows, cols = self.row_length, self.col_length
1098
1108
 
1099
1109
  # Map each column index to its full list of logical qubit indices
@@ -1121,6 +1131,55 @@ class QrackAceBackend:
1121
1131
  for r in range(0, rows):
1122
1132
  b = logical_index(r, c)
1123
1133
  if a != b:
1124
- coupling_map.add((a, b))
1134
+ coupling_map.append((a, b))
1135
+
1136
+ self._coupling_map = sorted(coupling_map)
1125
1137
 
1126
- return sorted(coupling_map)
1138
+ return self._coupling_map
1139
+
1140
+ # Designed by Dan, and implemented by Elara:
1141
+ def create_noise_model(self, x=0.25, y=0.25):
1142
+ if not _IS_QISKIT_AER_AVAILABLE:
1143
+ raise RuntimeError(
1144
+ "Before trying to run_qiskit_circuit() with QrackAceBackend, you must install Qiskit Aer!"
1145
+ )
1146
+ noise_model = NoiseModel()
1147
+
1148
+ for a, b in self.get_logical_coupling_map():
1149
+ col_a, col_b = a % self.row_length, b % self.row_length
1150
+ row_a, row_b = a // self.row_length, b // self.row_length
1151
+ is_long_a = self._is_col_long_range[col_a]
1152
+ is_long_b = self._is_col_long_range[col_b]
1153
+
1154
+ if is_long_a and is_long_b:
1155
+ continue # No noise on long-to-long
1156
+
1157
+ same_col = col_a == col_b
1158
+ even_odd = (row_a % 2) != (row_b % 2)
1159
+
1160
+ if same_col and not even_odd:
1161
+ continue # No noise for even-even or odd-odd within a boundary column
1162
+
1163
+ if same_col:
1164
+ x_cy = 1 - (1 - x)**2
1165
+ x_swap = 1 - (1 - x)**3
1166
+ noise_model.add_quantum_error(depolarizing_error(x, 2), 'cx', [a, b])
1167
+ noise_model.add_quantum_error(depolarizing_error(x_cy, 2), 'cy', [a, b])
1168
+ noise_model.add_quantum_error(depolarizing_error(x_cy, 2), 'cz', [a, b])
1169
+ noise_model.add_quantum_error(depolarizing_error(x_swap, 2), 'swap', [a, b])
1170
+ elif is_long_a or is_long_b:
1171
+ y_cy = 1 - (1 - y)**2
1172
+ y_swap = 1 - (1 - y)**3
1173
+ noise_model.add_quantum_error(depolarizing_error(y, 2), 'cx', [a, b])
1174
+ noise_model.add_quantum_error(depolarizing_error(y_cy, 2), 'cy', [a, b])
1175
+ noise_model.add_quantum_error(depolarizing_error(y_cy, 2), 'cz', [a, b])
1176
+ noise_model.add_quantum_error(depolarizing_error(y_swap, 2), 'swap', [a, b])
1177
+ else:
1178
+ y_cy = 1 - (1 - y)**2
1179
+ y_swap = 1 - (1 - y)**3
1180
+ noise_model.add_quantum_error(depolarizing_error(y_cy, 2), 'cx', [a, b])
1181
+ noise_model.add_quantum_error(depolarizing_error(y_cy, 2), 'cy', [a, b])
1182
+ noise_model.add_quantum_error(depolarizing_error(y_cy, 2), 'cz', [a, b])
1183
+ noise_model.add_quantum_error(depolarizing_error(y_swap, 2), 'swap', [a, b])
1184
+
1185
+ return noise_model
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.49.5
3
+ Version: 1.49.6
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -7,7 +7,7 @@ from setuptools import setup
7
7
  from setuptools.command.build_py import build_py
8
8
 
9
9
 
10
- VERSION = "1.49.5"
10
+ VERSION = "1.49.6"
11
11
 
12
12
  # Read long description from README.
13
13
  README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
File without changes
File without changes
File without changes
File without changes
File without changes