pyqrack-cuda 1.32.31__tar.gz → 1.33.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.
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/Makefile +1 -1
- {pyqrack_cuda-1.32.31/pyqrack_cuda.egg-info → pyqrack_cuda-1.33.1}/PKG-INFO +1 -1
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_circuit.py +48 -1
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_system/qrack_system.py +6 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/setup.py +1 -1
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/LICENSE +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/README.md +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyproject.toml +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/util/__init__.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack/util/convert_qiskit_circuit_to_qasm_experiment.py +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.32.31 → pyqrack_cuda-1.33.1}/setup.cfg +0 -0
@@ -18,7 +18,7 @@ help:
|
|
18
18
|
build-deps:
|
19
19
|
ifneq ($(OS),Windows_NT)
|
20
20
|
ifeq ($(QRACK_PRESENT),)
|
21
|
-
git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout
|
21
|
+
git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 7bdd878a99cc5f5fb6e3a387d4a3f0b119612194; cd ..
|
22
22
|
endif
|
23
23
|
mkdir -p qrack/build
|
24
24
|
ifeq ($(UNAME_S),Linux)
|
@@ -217,6 +217,17 @@ class QrackCircuit:
|
|
217
217
|
|
218
218
|
return out
|
219
219
|
|
220
|
+
def out_to_string(self):
|
221
|
+
"""Output optimized circuit to string
|
222
|
+
|
223
|
+
Outputs the (optimized) circuit to a string.
|
224
|
+
"""
|
225
|
+
string_length = Qrack.qrack_lib.qcircuit_out_to_string_length(self.cid)
|
226
|
+
out = ctypes.create_string_buffer(string_length)
|
227
|
+
Qrack.qrack_lib.qcircuit_out_to_string(self.cid, out)
|
228
|
+
|
229
|
+
return out.value.decode("utf-8")
|
230
|
+
|
220
231
|
def file_gate_count(filename):
|
221
232
|
"""File gate count
|
222
233
|
|
@@ -230,6 +241,22 @@ class QrackCircuit:
|
|
230
241
|
tokens = file.read().split()
|
231
242
|
return int(tokens[1])
|
232
243
|
|
244
|
+
def to_qiskit_circuit(self):
|
245
|
+
"""Convert to a Qiskit circuit
|
246
|
+
|
247
|
+
Outputs a Qiskit circuit from a QrackCircuit.
|
248
|
+
|
249
|
+
Raises:
|
250
|
+
RuntimeErorr: Before trying to string_to_qiskit_circuit() with
|
251
|
+
QrackCircuit, you must install Qiskit, numpy, and math!
|
252
|
+
"""
|
253
|
+
if not _IS_QISKIT_AVAILABLE:
|
254
|
+
raise RuntimeError(
|
255
|
+
"Before trying to_qiskit_circuit() with QrackCircuit, you must install Qiskit, numpy, and math!"
|
256
|
+
)
|
257
|
+
|
258
|
+
return QrackCircuit.string_to_qiskit_circuit(self.out_to_string())
|
259
|
+
|
233
260
|
def file_to_qiskit_circuit(filename):
|
234
261
|
"""Convert an output file to a Qiskit circuit
|
235
262
|
|
@@ -251,7 +278,27 @@ class QrackCircuit:
|
|
251
278
|
|
252
279
|
tokens = []
|
253
280
|
with open(filename, 'r') as file:
|
254
|
-
|
281
|
+
return QrackCircuit.string_to_qiskit_circuit(file.read())
|
282
|
+
|
283
|
+
def string_to_qiskit_circuit(circ_string):
|
284
|
+
"""Convert an output string to a Qiskit circuit
|
285
|
+
|
286
|
+
Reads in an (optimized) circuit from a string
|
287
|
+
parameter and outputs a Qiskit circuit.
|
288
|
+
|
289
|
+
Args:
|
290
|
+
circ_string: String representation of circuit
|
291
|
+
|
292
|
+
Raises:
|
293
|
+
RuntimeErorr: Before trying to string_to_qiskit_circuit() with
|
294
|
+
QrackCircuit, you must install Qiskit, numpy, and math!
|
295
|
+
"""
|
296
|
+
if not _IS_QISKIT_AVAILABLE:
|
297
|
+
raise RuntimeError(
|
298
|
+
"Before trying to string_to_qiskit_circuit() with QrackCircuit, you must install Qiskit, numpy, and math!"
|
299
|
+
)
|
300
|
+
|
301
|
+
tokens = circ_string.split()
|
255
302
|
|
256
303
|
i = 0
|
257
304
|
num_qubits = int(tokens[i])
|
@@ -1275,3 +1275,9 @@ class QrackSystem:
|
|
1275
1275
|
|
1276
1276
|
self.qrack_lib.qcircuit_in_from_file.restype = None
|
1277
1277
|
self.qrack_lib.qcircuit_in_from_file.argtypes = [c_ulonglong, c_char_p]
|
1278
|
+
|
1279
|
+
self.qrack_lib.qcircuit_out_to_string_length.restype = c_size_t
|
1280
|
+
self.qrack_lib.qcircuit_out_to_string_length.argtypes = [c_ulonglong]
|
1281
|
+
|
1282
|
+
self.qrack_lib.qcircuit_out_to_string.restype = None
|
1283
|
+
self.qrack_lib.qcircuit_out_to_string.argtypes = [c_ulonglong, c_char_p]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|