pyqrack-complex128 1.81.0__py3-none-macosx_14_0_arm64.whl → 1.82.0__py3-none-macosx_14_0_arm64.whl

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.

Potentially problematic release.


This version of pyqrack-complex128 might be problematic. Click here for more details.

pyqrack/qrack_neuron.py CHANGED
@@ -106,26 +106,50 @@ class QrackNeuron:
106
106
  return (ctypes.c_float * len(a))(*a)
107
107
  return (ctypes.c_double * len(a))(*a)
108
108
 
109
- def set_simulator(self, s):
109
+ def set_simulator(self, s, controls=None, target=None):
110
110
  """Set the neuron simulator
111
111
 
112
112
  Set the simulator used by this neuron
113
113
 
114
114
  Args:
115
115
  s(QrackSimulator): The simulator to use
116
+ controls(list[int]): The control qubit IDs to use
117
+ target(int): The output qubit ID to use
116
118
 
117
119
  Raises:
118
120
  RuntimeError: QrackSimulator raised an exception.
119
121
  """
122
+ if controls is None:
123
+ controls = self.controls
124
+ if target is None:
125
+ target = self.target
120
126
  Qrack.qrack_lib.set_qneuron_sim(
121
127
  self.nid,
122
128
  s.sid,
123
- len(self.controls),
124
- QrackNeuron._ulonglong_byref(self.controls),
125
- self.target,
129
+ len(controls),
130
+ QrackNeuron._ulonglong_byref(controls),
131
+ target,
126
132
  )
127
133
  self._throw_if_error()
128
134
  self.simulator = s
135
+ self.controls = controls
136
+ self.target = target
137
+
138
+ def set_qubit_ids(self, controls, target=None):
139
+ """Set the neuron qubit identifiers
140
+
141
+ Set the control and target qubits within the simulator
142
+
143
+ Args:
144
+ controls(list[int]): The control qubit IDs to use
145
+ target(int): The output qubit ID to use
146
+
147
+ Raises:
148
+ RuntimeError: QrackSimulator raised an exception.
149
+ """
150
+ if target is None:
151
+ target = self.target
152
+ self.set_simulator(self.simulator, controls, target)
129
153
 
130
154
  def set_angles(self, a):
131
155
  """Directly sets the neuron parameters.
@@ -77,7 +77,6 @@ class QrackSimulator:
77
77
  "Cannot clone a QrackSimulator and specify its qubit length at the same time, in QrackSimulator constructor!"
78
78
  )
79
79
 
80
- self.is_tensor_network = isTensorNetwork
81
80
  self.is_pure_stabilizer = False
82
81
 
83
82
  if cloneSid > -1:
@@ -1307,15 +1306,11 @@ class QrackSimulator:
1307
1306
 
1308
1307
  Raises:
1309
1308
  RuntimeError: QrackSimulator raised an exception.
1310
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot mul()! (Turn off just this option, in the constructor.)
1309
+ RuntimeError: QrackStabilizer cannot mul()! (Create a QrackSimulator instead.)
1311
1310
  """
1312
- if self.is_tensor_network:
1313
- raise RuntimeError(
1314
- "QrackSimulator with isTensorNetwork=True option cannot mul()! (Turn off just this option, in the constructor.)"
1315
- )
1316
1311
  if self.is_pure_stabilizer:
1317
1312
  raise RuntimeError(
1318
- "QrackStabilizer cannot mul()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1313
+ "QrackStabilizer cannot mul()! (Create a QrackSimulator instead.)"
1319
1314
  )
1320
1315
 
1321
1316
  if len(q) != len(o):
@@ -1346,15 +1341,11 @@ class QrackSimulator:
1346
1341
 
1347
1342
  Raises:
1348
1343
  RuntimeError: QrackSimulator raised an exception.
1349
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot div()! (Turn off just this option, in the constructor.)
1344
+ RuntimeError: QrackStabilizer cannot div()! (Create a QrackSimulator instead.)
1350
1345
  """
1351
- if self.is_tensor_network:
1352
- raise RuntimeError(
1353
- "QrackSimulator with isTensorNetwork=True option cannot div()! (Turn off just this option, in the constructor.)"
1354
- )
1355
1346
  if self.is_pure_stabilizer:
1356
1347
  raise RuntimeError(
1357
- "QrackStabilizer cannot div()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1348
+ "QrackStabilizer cannot div()! (Create a QrackSimulator instead.)"
1358
1349
  )
1359
1350
 
1360
1351
  if len(q) != len(o):
@@ -1443,15 +1434,11 @@ class QrackSimulator:
1443
1434
 
1444
1435
  Raises:
1445
1436
  RuntimeError: QrackSimulator raised an exception.
1446
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot pown()! (Turn off just this option, in the constructor.)
1437
+ RuntimeError: QrackStabilizer cannot pown()! (Create a QrackSimulator instead.)
1447
1438
  """
1448
- if self.is_tensor_network:
1449
- raise RuntimeError(
1450
- "QrackSimulator with isTensorNetwork=True option cannot pown()! (Turn off just this option, in the constructor.)"
1451
- )
1452
1439
  if self.is_pure_stabilizer:
1453
1440
  raise RuntimeError(
1454
- "QrackStabilizer cannot pown()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1441
+ "QrackStabilizer cannot pown()! (Create a QrackSimulator instead.)"
1455
1442
  )
1456
1443
 
1457
1444
  if len(q) != len(o):
@@ -1536,15 +1523,11 @@ class QrackSimulator:
1536
1523
 
1537
1524
  Raises:
1538
1525
  RuntimeError: QrackSimulator raised an exception.
1539
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot mcmul()! (Turn off just this option, in the constructor.)
1526
+ RuntimeError: QrackStabilizer cannot mcmul()! (Create a QrackSimulator instead.)
1540
1527
  """
1541
- if self.is_tensor_network:
1542
- raise RuntimeError(
1543
- "QrackSimulator with isTensorNetwork=True option cannot mcmul()! (Turn off just this option, in the constructor.)"
1544
- )
1545
1528
  if self.is_pure_stabilizer:
1546
1529
  raise RuntimeError(
1547
- "QrackStabilizer cannot mcmul()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1530
+ "QrackStabilizer cannot mcmul()! (Create a QrackSimulator instead.)"
1548
1531
  )
1549
1532
 
1550
1533
  if len(q) != len(o):
@@ -1578,15 +1561,11 @@ class QrackSimulator:
1578
1561
 
1579
1562
  Raises:
1580
1563
  RuntimeError: QrackSimulator raised an exception.
1581
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot mcdiv()! (Turn off just this option, in the constructor.)
1564
+ RuntimeError: QrackStabilizer cannot mcdiv()! (Create a QrackSimulator instead.)
1582
1565
  """
1583
- if self.is_tensor_network:
1584
- raise RuntimeError(
1585
- "QrackSimulator with isTensorNetwork=True option cannot mcdiv()! (Turn off just this option, in the constructor.)"
1586
- )
1587
1566
  if self.is_pure_stabilizer:
1588
1567
  raise RuntimeError(
1589
- "QrackStabilizer cannot mcdiv()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1568
+ "QrackStabilizer cannot mcdiv()! (Create a QrackSimulator instead.)"
1590
1569
  )
1591
1570
 
1592
1571
  if len(q) != len(o):
@@ -1686,15 +1665,11 @@ class QrackSimulator:
1686
1665
 
1687
1666
  Raises:
1688
1667
  RuntimeError: QrackSimulator raised an exception.
1689
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot mcpown()! (Turn off just this option, in the constructor.)
1668
+ RuntimeError: QrackStabilizer cannot mcpown()! (Create a QrackSimulator instead.)
1690
1669
  """
1691
- if self.is_tensor_network:
1692
- raise RuntimeError(
1693
- "QrackSimulator with isTensorNetwork=True option cannot mcpown()! (Turn off just this option, in the constructor.)"
1694
- )
1695
1670
  if self.is_pure_stabilizer:
1696
1671
  raise RuntimeError(
1697
- "QrackStabilizer cannot mcpown()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1672
+ "QrackStabilizer cannot mcpown()! (Create a QrackSimulator instead.)"
1698
1673
  )
1699
1674
 
1700
1675
  if len(q) != len(o):
@@ -1727,15 +1702,11 @@ class QrackSimulator:
1727
1702
 
1728
1703
  Raises:
1729
1704
  RuntimeError: QrackSimulator raised an exception.
1730
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot lda()! (Turn off just this option, in the constructor.)
1705
+ RuntimeError: QrackStabilizer cannot lda()! (Create a QrackSimulator instead.)
1731
1706
  """
1732
- if self.is_tensor_network:
1733
- raise RuntimeError(
1734
- "QrackSimulator with isTensorNetwork=True option cannot lda()! (Turn off just this option, in the constructor.)"
1735
- )
1736
1707
  if self.is_pure_stabilizer:
1737
1708
  raise RuntimeError(
1738
- "QrackStabilizer cannot lda()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1709
+ "QrackStabilizer cannot lda()! (Create a QrackSimulator instead.)"
1739
1710
  )
1740
1711
 
1741
1712
  Qrack.qrack_lib.LDA(
@@ -1761,15 +1732,11 @@ class QrackSimulator:
1761
1732
 
1762
1733
  Raises:
1763
1734
  RuntimeError: QrackSimulator raised an exception.
1764
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot adc()! (Turn off just this option, in the constructor.)
1735
+ RuntimeError: QrackStabilizer cannot adc()! (Create a QrackSimulator instead.)
1765
1736
  """
1766
- if self.is_tensor_network:
1767
- raise RuntimeError(
1768
- "QrackSimulator with isTensorNetwork=True option cannot adc()! (Turn off just this option, in the constructor.)"
1769
- )
1770
1737
  if self.is_pure_stabilizer:
1771
1738
  raise RuntimeError(
1772
- "QrackStabilizer cannot adc()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1739
+ "QrackStabilizer cannot adc()! (Create a QrackSimulator instead.)"
1773
1740
  )
1774
1741
 
1775
1742
  Qrack.qrack_lib.ADC(
@@ -1796,15 +1763,11 @@ class QrackSimulator:
1796
1763
 
1797
1764
  Raises:
1798
1765
  RuntimeError: QrackSimulator raised an exception.
1799
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot sbc()! (Turn off just this option, in the constructor.)
1766
+ RuntimeError: QrackStabilizer cannot sbc()! (Create a QrackSimulator instead.)
1800
1767
  """
1801
- if self.is_tensor_network:
1802
- raise RuntimeError(
1803
- "QrackSimulator with isTensorNetwork=True option cannot sbc()! (Turn off just this option, in the constructor.)"
1804
- )
1805
1768
  if self.is_pure_stabilizer:
1806
1769
  raise RuntimeError(
1807
- "QrackStabilizer cannot sbc()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1770
+ "QrackStabilizer cannot sbc()! (Create a QrackSimulator instead.)"
1808
1771
  )
1809
1772
 
1810
1773
  Qrack.qrack_lib.SBC(
@@ -1832,15 +1795,11 @@ class QrackSimulator:
1832
1795
 
1833
1796
  Raises:
1834
1797
  RuntimeError: QrackSimulator raised an exception.
1835
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot hash()! (Turn off just this option, in the constructor.)
1798
+ RuntimeError: QrackStabilizer cannot hash()! (Create a QrackSimulator instead.)
1836
1799
  """
1837
- if self.is_tensor_network:
1838
- raise RuntimeError(
1839
- "QrackSimulator with isTensorNetwork=True option cannot hash()! (Turn off just this option, in the constructor.)"
1840
- )
1841
1800
  if self.is_pure_stabilizer:
1842
1801
  raise RuntimeError(
1843
- "QrackStabilizer cannot hash()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
1802
+ "QrackStabilizer cannot hash()! (Create a QrackSimulator instead.)"
1844
1803
  )
1845
1804
 
1846
1805
  Qrack.qrack_lib.Hash(
@@ -2150,13 +2109,7 @@ class QrackSimulator:
2150
2109
 
2151
2110
  Raises:
2152
2111
  RuntimeError: QrackSimulator raised an exception.
2153
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot compose()! (Turn off just this option, in the constructor.)
2154
2112
  """
2155
- if self.is_tensor_network:
2156
- raise RuntimeError(
2157
- "QrackSimulator with isTensorNetwork=True option cannot compose()! (Turn off just this option, in the constructor.)"
2158
- )
2159
-
2160
2113
  Qrack.qrack_lib.Compose(self.sid, other.sid, QrackSimulator._ulonglong_byref(q))
2161
2114
  self._throw_if_error()
2162
2115
 
@@ -2170,16 +2123,10 @@ class QrackSimulator:
2170
2123
 
2171
2124
  Raises:
2172
2125
  RuntimeError: QrackSimulator raised an exception.
2173
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot decompose()! (Turn off just this option, in the constructor.)
2174
2126
 
2175
2127
  Returns:
2176
2128
  Decomposed subsystem simulator.
2177
2129
  """
2178
- if self.is_tensor_network:
2179
- raise RuntimeError(
2180
- "QrackSimulator with isTensorNetwork=True option cannot decompose()! (Turn off just this option, in the constructor.)"
2181
- )
2182
-
2183
2130
  other = QrackSimulator()
2184
2131
  Qrack.qrack_lib.destroy(other.sid)
2185
2132
  l = len(q)
@@ -2198,13 +2145,7 @@ class QrackSimulator:
2198
2145
 
2199
2146
  Raises:
2200
2147
  RuntimeError: QrackSimulator raised an exception.
2201
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot dispose()! (Turn off just this option, in the constructor.)
2202
2148
  """
2203
- if self.is_tensor_network:
2204
- raise RuntimeError(
2205
- "QrackSimulator with isTensorNetwork=True option cannot dispose()! (Turn off just this option, in the constructor.)"
2206
- )
2207
-
2208
2149
  l = len(q)
2209
2150
  Qrack.qrack_lib.Dispose(self.sid, l, QrackSimulator._ulonglong_byref(q))
2210
2151
  self._throw_if_error()
@@ -3128,15 +3069,11 @@ class QrackSimulator:
3128
3069
 
3129
3070
  Raises:
3130
3071
  RuntimeError: QrackSimulator raised an exception.
3131
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot phase_parity()! (Turn off just this option, in the constructor.)
3072
+ RuntimeError: QrackStabilizer cannot phase_parity()! (Create a QrackSimulator instead.)
3132
3073
  """
3133
- if self.is_tensor_network:
3134
- raise RuntimeError(
3135
- "QrackSimulator with isTensorNetwork=True option cannot phase_parity()! (Turn off just this option, in the constructor.)"
3136
- )
3137
3074
  if self.is_pure_stabilizer:
3138
3075
  raise RuntimeError(
3139
- "QrackStabilizer cannot phase_parity()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
3076
+ "QrackStabilizer cannot phase_parity()! (Create a QrackSimulator instead.)"
3140
3077
  )
3141
3078
 
3142
3079
  Qrack.qrack_lib.PhaseParity(
@@ -3155,15 +3092,11 @@ class QrackSimulator:
3155
3092
 
3156
3093
  Raises:
3157
3094
  RuntimeError: QrackSimulator raised an exception.
3158
- RuntimeError: QrackSimulator with isTensorNetwork=True option cannot phase_root_n()! (Turn off just this option, in the constructor.)
3095
+ RuntimeError: QrackStabilizer cannot phase_root_n()! (Create a QrackSimulator instead.)
3159
3096
  """
3160
- if self.is_tensor_network:
3161
- raise RuntimeError(
3162
- "QrackSimulator with isTensorNetwork=True option cannot phase_root_n()! (Turn off just this option, in the constructor.)"
3163
- )
3164
3097
  if self.is_pure_stabilizer:
3165
3098
  raise RuntimeError(
3166
- "QrackStabilizer cannot phase_root_n()! (Create a QrackSimulator instead, also with isTensorNetwork=False.)"
3099
+ "QrackStabilizer cannot phase_root_n()! (Create a QrackSimulator instead.)"
3167
3100
  )
3168
3101
 
3169
3102
  Qrack.qrack_lib.PhaseRootN(self.sid, n, len(q), QrackSimulator._ulonglong_byref(q))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-complex128
3
- Version: 1.81.0
3
+ Version: 1.82.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -3,9 +3,9 @@ pyqrack/neuron_activation_fn.py,sha256=fQTTFfsvwcot_43Vopacot47IV2Rxk8pelUyuzwpX
3
3
  pyqrack/pauli.py,sha256=wg500wDOwdIU4lEVJoMmjtbAdmtakZYzLPjdzC2rwUQ,654
4
4
  pyqrack/qrack_ace_backend.py,sha256=-LSEX-M_hg-17LL27rLh8fpwuJaMEQeQpXzYoiuC21A,49143
5
5
  pyqrack/qrack_circuit.py,sha256=jcelcoRrAWJBs9OrjBKkCba1MEIUcXeXDMKH3iwOl2Y,19778
6
- pyqrack/qrack_neuron.py,sha256=b5n3kZzTg-qYKOMmaeigalP5cBzZCarMjDeOjwprCtI,12084
6
+ pyqrack/qrack_neuron.py,sha256=8yvtkDvouRIvmXOtOn57h50WHBPwfegjFNXixfeTTqE,12901
7
7
  pyqrack/qrack_neuron_torch_layer.py,sha256=1h3vD4iG662b6ZqOC7y6IDtI2ul7dUtNaAPal8mfCjg,10560
8
- pyqrack/qrack_simulator.py,sha256=41nQEjC8IRhPz2_McpH9G-1T7V1aFK82RRKLxt1oJeo,148879
8
+ pyqrack/qrack_simulator.py,sha256=9ASloxjg2e0DznQr5GVmyRUT_1EPdmjrBgijtJu-O9I,144263
9
9
  pyqrack/qrack_stabilizer.py,sha256=O-7VJ9Vw4h25PK_kesSjIqHXGSo8lLrQLIyGgmzG7Co,2124
10
10
  pyqrack/quimb_circuit_type.py,sha256=Sk-Tmn38kUYmAkJJ75btWuhYZyTXOOezmowFhfdiGDc,621
11
11
  pyqrack/qrack_system/__init__.py,sha256=-oZ9dsb1hixsnrkUJRY_C5DzQ_l6MtifF_Z465BgqV4,334
@@ -16,8 +16,8 @@ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.dylib,sha256=0bh-LK3kx7RVay1vKgj
16
16
  pyqrack/stats/__init__.py,sha256=Hla85my2fY_roR9lIjGBVpEG7ySOTMwjWa8D6-kgCnY,276
17
17
  pyqrack/stats/load_quantized_data.py,sha256=10-ZULlnSX45br7fDtJuiCzcMTAL4eI3QyhSENXZjgM,1162
18
18
  pyqrack/stats/quantize_by_range.py,sha256=zPLMNuuyzMPvB-K9Ukc-RjzIzwCsZkzuT2gZneCeCBg,2210
19
- pyqrack_complex128-1.81.0.dist-info/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
- pyqrack_complex128-1.81.0.dist-info/METADATA,sha256=begBnsDIsLJql4e-DZBQHaVvuu8Q_O8cQBcYJgXxfuw,5992
21
- pyqrack_complex128-1.81.0.dist-info/WHEEL,sha256=BM14wstXunLvpW3hePaerLq1eZfN4NnYgS3CIXR7_AM,106
22
- pyqrack_complex128-1.81.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
- pyqrack_complex128-1.81.0.dist-info/RECORD,,
19
+ pyqrack_complex128-1.82.0.dist-info/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
20
+ pyqrack_complex128-1.82.0.dist-info/METADATA,sha256=PEYRsxFTkFPge0WboaWrrQXPxa8sUWBs4IrTcDBqnxY,5992
21
+ pyqrack_complex128-1.82.0.dist-info/WHEEL,sha256=BM14wstXunLvpW3hePaerLq1eZfN4NnYgS3CIXR7_AM,106
22
+ pyqrack_complex128-1.82.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
23
+ pyqrack_complex128-1.82.0.dist-info/RECORD,,