pyqrack-cuda 1.34.0__tar.gz → 1.34.4__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.34.0/pyqrack_cuda.egg-info → pyqrack_cuda-1.34.4}/PKG-INFO +1 -1
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_circuit.py +25 -16
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4/pyqrack_cuda.egg-info}/PKG-INFO +1 -1
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/setup.py +1 -1
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/LICENSE +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/MANIFEST.in +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/Makefile +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/README.md +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyproject.toml +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/__init__.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/neuron_activation_fn.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/pauli.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_neuron.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_simulator.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_system/__init__.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_system/qrack_system.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/quimb_circuit_type.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/util/__init__.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/util/convert_qiskit_circuit_to_qasm_experiment.py +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/requires.txt +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack_cuda.egg-info/top_level.txt +0 -0
- {pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/setup.cfg +0 -0
@@ -385,6 +385,18 @@ class QrackCircuit:
|
|
385
385
|
|
386
386
|
return circ
|
387
387
|
|
388
|
+
def _u3_to_mtrx(params):
|
389
|
+
th = float(params[0])
|
390
|
+
ph = float(params[1])
|
391
|
+
lm = float(params[2])
|
392
|
+
|
393
|
+
c = math.cos(th / 2)
|
394
|
+
s = math.sin(th / 2)
|
395
|
+
el = np.exp(1j * lm)
|
396
|
+
ep = np.exp(1j * ph)
|
397
|
+
|
398
|
+
return [ c + 0j, -el * s, ep * s, el * ep * c]
|
399
|
+
|
388
400
|
def in_from_qiskit_circuit(circ):
|
389
401
|
"""Read a Qiskit circuit into a QrackCircuit
|
390
402
|
|
@@ -404,29 +416,26 @@ class QrackCircuit:
|
|
404
416
|
|
405
417
|
out = QrackCircuit()
|
406
418
|
|
407
|
-
basis_gates = ["u", "cx"]
|
408
|
-
circ = transpile(circ, basis_gates=basis_gates, optimization_level=
|
419
|
+
basis_gates = ["x", "y", "z", "u", "cx", "cy", "cz", "cu"]
|
420
|
+
circ = transpile(circ, basis_gates=basis_gates, optimization_level=0)
|
409
421
|
for gate in circ.data:
|
410
422
|
o = gate.operation
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
op =
|
420
|
-
|
421
|
-
-np.exp(1j * lm) * s,
|
422
|
-
np.exp(1j * ph) * s,
|
423
|
-
np.exp(1j * (ph + lm)) * c
|
424
|
-
]
|
423
|
+
op = []
|
424
|
+
if o.name in ["x", "cx"]:
|
425
|
+
op = [0, 1, 1, 0]
|
426
|
+
elif o.name in ["y", "cy"]:
|
427
|
+
op = [0, -1j, 1j, 0]
|
428
|
+
elif o.name in ["z", "cz"]:
|
429
|
+
op = [1, 0, 0, -1]
|
430
|
+
else:
|
431
|
+
op = QrackCircuit._u3_to_mtrx(o.params)
|
432
|
+
if o.name in ["x", "y", "z", "u"]:
|
425
433
|
out.mtrx(op, circ.find_bit(gate.qubits[0])[0])
|
426
434
|
else:
|
427
435
|
ctrls = []
|
428
436
|
for c in gate.qubits[0:1]:
|
429
437
|
ctrls.append(circ.find_bit(c)[0])
|
438
|
+
|
430
439
|
out.ucmtrx(ctrls, [0, 1, 1, 0], circ.find_bit(gate.qubits[1])[0], 1)
|
431
440
|
|
432
441
|
return out
|
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
|
{pyqrack_cuda-1.34.0 → pyqrack_cuda-1.34.4}/pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so
RENAMED
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
|