Skip to content
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

Update cirq-core requirement from <1.4.0,>=1.0.0 to >=1.0.0,<1.5.0 #2390

Merged
merged 8 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,010 changes: 5,010 additions & 0 deletions docs/source/examples/resources/rshadows-tutorial-1D_Ising_g=1_16qubits.json

Large diffs are not rendered by default.

Binary file not shown.
1,326 changes: 1,326 additions & 0 deletions docs/source/examples/resources/rshadows-tutorial-1D_Ising_g=1_8qubits.json

Large diffs are not rendered by default.

Binary file not shown.
12 changes: 5 additions & 7 deletions docs/source/examples/rshadows_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ num_qubits = 8
qubits: List[cirq.Qid] = cirq.LineQubit.range(num_qubits)

if download_ising_circuits:
with open(f"{file_directory}/rshadows-tutorial-1D_Ising_g=1_{num_qubits}qubits.pkl", "rb") as file:
old_cirq_circuit = pickle.load(file)
circuit = cirq.Circuit(old_cirq_circuit.all_operations())
with open(f"{file_directory}/rshadows-tutorial-1D_Ising_g=1_{num_qubits}qubits.json", "rb") as file:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoa, awesome that we finally got rid of those pickles 🥒

circuit = cirq.read_json(json_text=file.read())
g = 1

# or user can import from tensorflow_quantum
Expand Down Expand Up @@ -499,9 +498,8 @@ Import groud state of 1-D Ising model with periodic boundary condition
num_qubits = 16
qubits = cirq.LineQubit.range(num_qubits)
if download_ising_circuits:
with open(f"{file_directory}/rshadows-tutorial-1D_Ising_g=1_{num_qubits}qubits.pkl", "rb") as file:
old_cirq_circuit = pickle.load(file)
circuit = cirq.Circuit(old_cirq_circuit.all_operations())
with open(f"{file_directory}/rshadows-tutorial-1D_Ising_g=1_{num_qubits}qubits.json", "rb") as file:
circuit = cirq.read_json(json_text=file.read())
g = 1
else:
qbs = cirq.GridQubit.rect(num_qubits, 1)
Expand All @@ -515,7 +513,7 @@ else:
circuit = circuit.transform_qubits(qubit_map=qubit_map)
```

Define obersevables lists as two point correlation functions between the first qubit and the rest of the qubits $\{\langle Z_0 Z_i\rangle\}_{0\geq i\leq n-1}$
Define a list of observables as two point correlation functions between the first qubit and every other qubit $\{\langle Z_0 Z_i\rangle\}_{0\leq i\leq n-1}$.


```{code-cell} ipython3
Expand Down
10 changes: 2 additions & 8 deletions mitiq/benchmarks/randomized_benchmarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import numpy as np
from cirq.experiments.qubit_characterizations import (
_find_inv_matrix,
_gate_seq_to_mats,
_reduce_gate_seq,
_single_qubit_cliffords,
_two_qubit_clifford,
_two_qubit_clifford_matrices,
Expand Down Expand Up @@ -60,20 +60,14 @@ def generate_rb_circuits(
rng = np.random.RandomState(seed)
if n_qubits == 1:
c1 = cliffords.c1_in_xy
cfd_mat_1q = np.array(
[_gate_seq_to_mats(gates) for gates in c1], dtype=np.complex64
)
circuits = []
clifford_group_size = 24
for _ in range(trials):
gate_ids = list(rng.choice(clifford_group_size, num_cliffords))
gate_sequence = [
gate for gate_id in gate_ids for gate in c1[gate_id]
]
idx = _find_inv_matrix(
_gate_seq_to_mats(gate_sequence), cfd_mat_1q
)
gate_sequence.extend(c1[idx])
gate_sequence.append(_reduce_gate_seq(gate_sequence) ** -1)
circuits.append(
cirq.Circuit(gate(qubits[0]) for gate in gate_sequence)
)
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-braket.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
amazon-braket-sdk~=1.69.0
cirq-ionq>=1.0.0,<1.4.0
cirq-ionq>=1.4.0,<1.5.0
2 changes: 1 addition & 1 deletion requirements/requirements-cirq.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is redundant, since Cirq is the core internal representation
# for quantum circuits in Mitiq.
# Keeping this file anyway for consistency with other integrations.
cirq-core>=1.0.0,<1.4.0
cirq-core>=1.4.0,<1.5.0
2 changes: 1 addition & 1 deletion requirements/requirements-pyquil.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pyquil~=3.5.4
cirq-rigetti>=1.0.0,<1.4.0
cirq-rigetti>=1.4.0,<1.5.0
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy>=1.22.0
scipy>=1.10.1,<=1.14.1
cirq-core>=1.0.0,<1.4.0
cirq-core>=1.4.0,<1.5.0
tabulate