-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-organize files so QASM circuits live in a different directory than… #128
Changes from 16 commits
7c31f0d
8fec3e6
be7a81e
ede7041
1707a1c
03ee51f
d266bf5
ce66799
529b2a0
4b478e3
2984e8b
d70c7ad
79db120
81d4f3e
252ff16
24fa29b
e3c3be6
f353960
df923b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
from .write_qasm import write_qasm | ||
from .scripts import log_performance, save_results |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
compiler,circuit_name,raw_multiq_gates,compile_time,compiled_multiq_gates | ||
qiskit,qaoa_barabasi_albert,1176,0.18260502815246582,1176 | ||
pytket,qaoa_barabasi_albert,1176,0.022324562072753906,1176 | ||
ucc,qaoa_barabasi_albert,1176,0.7321248054504395,1176 | ||
cirq,qaoa_barabasi_albert,1176,7.504948854446411,1176 | ||
qiskit,qft,10050,0.5772039890289307,3244 | ||
ucc,qft,10050,2.8528826236724854,2740 | ||
pytket,qft,10050,0.27750396728515625,5890 | ||
ucc,square_heisenberg,2160,0.3288688659667969,540 | ||
qiskit,square_heisenberg,2160,0.2869715690612793,540 | ||
pytket,square_heisenberg,2160,0.12201833724975586,2160 | ||
cirq,square_heisenberg,2160,9.324482917785645,540 | ||
ucc,prep_select,9744,6.975432395935059,9702 | ||
qiskit,prep_select,9744,1.6321191787719727,9708 | ||
ucc,qcnn,388,0.1713879108428955,388 | ||
qiskit,qcnn,388,0.08201837539672852,388 | ||
cirq,qft,10050,50.458903789520264,4648 | ||
pytket,qcnn,388,0.03914165496826172,388 | ||
pytket,prep_select,9744,0.3006443977355957,9712 | ||
cirq,qcnn,388,2.2956674098968506,388 | ||
cirq,prep_select,9744,72.23616528511047,9712 | ||
pytket,qv,15000,4.486355781555176,15000 | ||
ucc,qv,15000,4.734463453292847,14856 | ||
qiskit,qv,15000,5.65778374671936,14856 | ||
cirq,qv,15000,190.9960744380951,14856 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating imports because of moved modules and new script (vs. notebook) for generating the qasm code |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from .common import log_performance, save_results | ||
from .common import log_performance, save_results | ||
from .qiskit_circuits import qaoa_ising_ansatz, qcnn_circuit, VQE_ansatz, random_clifford_circuit | ||
from .cirq_circuits import cirq_prep_select |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just converting the old notebook version to a script |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason this file needs to be an executable? |
||
# coding: utf-8 | ||
|
||
# ### Prepare & Select | ||
# Prepare an N-qubit GHZ state and select the all ones state. | ||
|
||
from write_qasm import write_qasm | ||
from cirq_circuits import VQE_ansatz, cirq_prep_select | ||
from qiskit_circuits import qcnn_circuit, qaoa_ising_ansatz | ||
from numpy import log2, ceil | ||
|
||
|
||
# ### Prepare & Select | ||
num_qubits = 25 | ||
target_state="1" * num_qubits | ||
|
||
circuit = cirq_prep_select(num_qubits, target_state=target_state) | ||
filename = f"prep_select_N{num_qubits}_ghz" | ||
|
||
write_qasm(circuit, | ||
circuit_name=filename, | ||
# basis_gates=['rz', 'rx', 'ry', 'h', 'cx'] | ||
) | ||
jordandsullivan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# ### QCNN circuit | ||
num_qubits = 100 | ||
num_layers = int(ceil(log2(num_qubits))) | ||
|
||
seed = 12345 | ||
|
||
circuit = qcnn_circuit(num_qubits, seed=seed) | ||
filename = f"qcnn_N{num_qubits}_{num_layers}layers" | ||
|
||
write_qasm(circuit, | ||
circuit_name=filename, | ||
basis_gates=['rz', 'rx', 'ry', 'h', 'cx']) | ||
|
||
# ### Parameterized VQE ansatz | ||
num_qubits = 50 | ||
num_layers = num_qubits * 2 | ||
num_layers = num_qubits * 2 | ||
|
||
circuit = VQE_ansatz(num_qubits, num_layers) | ||
filename = f"VQE_ansatz_N{num_qubits}_{num_layers}layers" | ||
|
||
write_qasm(circuit, circuit_name=filename, version='3') | ||
|
||
# ### QAOA neighest neighbors Ising mode | ||
num_qubits = 50 | ||
num_layers = num_qubits * 3 | ||
|
||
circuit = qaoa_ising_ansatz(num_qubits, num_layers) | ||
filename = f"QAOA_Ising_ansatz_N{num_qubits}_{num_layers}layers" | ||
|
||
write_qasm(circuit, circuit_name=filename, version='3') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .circuits import qcnn_circuit, VQE_ansatz, qaoa_ising_ansatz | ||
from .circuits import qcnn_circuit, VQE_ansatz, qaoa_ising_ansatz, random_clifford_circuit |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating import references for moved files. I could see an argument that it doesn't make sense to have the Qiskit and Cirq files inside the benchmarks/scripts module though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted this to a script (see below).