Skip to content

Commit

Permalink
Update cirq-core requirement from <1.4.0,>=1.0.0 to >=1.0.0,<1.5.0 (#…
Browse files Browse the repository at this point in the history
…2390)

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

Updates the requirements on [cirq-core](https://github.com/quantumlib/cirq) to permit the latest version.
- [Release notes](https://github.com/quantumlib/cirq/releases)
- [Changelog](https://github.com/quantumlib/Cirq/blob/main/release.md)
- [Commits](quantumlib/Cirq@v1.0.0...v1.4.0)

---
updated-dependencies:
- dependency-name: cirq-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Remove dependency to deprecated Cirq internal function

* bump min cirq-core (and friends) to 1.4

* move pickled circuits to json

* fix typo

* typo (again)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alessandro Cosentino <[email protected]>
Co-authored-by: nate stemen <[email protected]>
  • Loading branch information
3 people authored Aug 28, 2024
1 parent d22df7b commit 6512dbe
Show file tree
Hide file tree
Showing 10 changed files with 6,347 additions and 19 deletions.
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:
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

0 comments on commit 6512dbe

Please sign in to comment.