Skip to content

Commit

Permalink
cirq.google -> cirq_google renames
Browse files Browse the repository at this point in the history
  • Loading branch information
balopat committed Apr 19, 2021
1 parent a9768d8 commit 0cd59ea
Show file tree
Hide file tree
Showing 137 changed files with 816 additions and 816 deletions.
2 changes: 1 addition & 1 deletion cirq/contrib/paulistring/recombine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _assert_no_multi_qubit_pauli_strings(circuit: cirq.Circuit) -> None:


def test_move_non_clifford_into_clifford():
cg = pytest.importorskip("cirq.google")
cg = pytest.importorskip("cirq_google")
q0, q1, q2 = cirq.LineQubit.range(3)
c_orig = cirq.testing.nonoptimal_toffoli_circuit(q0, q1, q2)

Expand Down
4 changes: 2 additions & 2 deletions cirq/experiments/google_v2_supremacy_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def count_neighbors(qubits, qubit):
assert 2 <= n_rows <= 11
max_row = n_rows - 1
# to avoid circular dependencies
import cirq.google
import cirq_google

dev = cirq.google.Bristlecone
dev = cirq_google.Bristlecone
# we need a consistent order of qubits
qubits = list(dev.qubits)
qubits.sort()
Expand Down
4 changes: 2 additions & 2 deletions cirq/experiments/google_v2_supremacy_circuit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_google_v2_supremacy_circuit():


def test_google_v2_supremacy_bristlecone():
pytest.importorskip("cirq.google")
pytest.importorskip("cirq_google")
# Check instance consistency
c = supremacy_v2.generate_boixo_2018_supremacy_circuits_v2_bristlecone(
n_rows=11, cz_depth=8, seed=0
Expand All @@ -72,7 +72,7 @@ def test_google_v2_supremacy_bristlecone():


def test_n_rows_less_than_2():
pytest.importorskip("cirq.google")
pytest.importorskip("cirq_google")
with pytest.raises(AssertionError):
supremacy_v2.generate_boixo_2018_supremacy_circuits_v2_bristlecone(
n_rows=1, cz_depth=0, seed=0
Expand Down
30 changes: 15 additions & 15 deletions cirq/google/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

"""Classes for working with Google's Quantum Engine API."""

from cirq.google import api
from cirq_google import api

from cirq.google.arg_func_langs import (
from cirq_google.arg_func_langs import (
arg_from_proto,
)

from cirq.google.calibration import (
from cirq_google.calibration import (
ALL_ANGLES_FLOQUET_PHASED_FSIM_CHARACTERIZATION,
CircuitWithCalibration,
FloquetPhasedFSimCalibrationOptions,
Expand All @@ -45,7 +45,7 @@
WITHOUT_CHI_FLOQUET_PHASED_FSIM_CHARACTERIZATION,
)

from cirq.google.devices import (
from cirq_google.devices import (
Bristlecone,
Foxtail,
SerializableDevice,
Expand All @@ -54,7 +54,7 @@
XmonDevice,
)

from cirq.google.engine import (
from cirq_google.engine import (
Calibration,
CalibrationLayer,
CalibrationResult,
Expand All @@ -71,29 +71,29 @@
get_engine_sampler,
)

from cirq.google.gate_sets import (
from cirq_google.gate_sets import (
XMON,
FSIM_GATESET,
SQRT_ISWAP_GATESET,
SYC_GATESET,
NAMED_GATESETS,
)

from cirq.google.line import (
from cirq_google.line import (
AnnealSequenceSearchStrategy,
GreedySequenceSearchStrategy,
line_on_device,
LinePlacementStrategy,
)

from cirq.google.ops import (
from cirq_google.ops import (
CalibrationTag,
PhysicalZTag,
SycamoreGate,
SYC,
)

from cirq.google.optimizers import (
from cirq_google.optimizers import (
ConvertToXmonGates,
ConvertToSqrtIswapGates,
ConvertToSycamoreGates,
Expand All @@ -102,27 +102,27 @@
optimized_for_xmon,
)

from cirq.google.op_deserializer import (
from cirq_google.op_deserializer import (
DeserializingArg,
GateOpDeserializer,
)

from cirq.google.op_serializer import (
from cirq_google.op_serializer import (
GateOpSerializer,
SerializingArg,
)

from cirq.google.serializable_gate_set import (
from cirq_google.serializable_gate_set import (
SerializableGateSet,
)

from cirq.google import experimental
from cirq_google import experimental


def _register_resolver() -> None:
"""Registers the cirq.google's public classes for JSON serialization."""
"""Registers the cirq_google's public classes for JSON serialization."""
from cirq.protocols.json_serialization import _internal_register_resolver
from cirq.google.json_resolver_cache import _class_resolver_dictionary
from cirq_google.json_resolver_cache import _class_resolver_dictionary

_internal_register_resolver(_class_resolver_dictionary)

Expand Down
2 changes: 1 addition & 1 deletion cirq/google/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
"""Helpers for converting to/from api data formats."""

from cirq.google.api import v2
from cirq_google.api import v2
6 changes: 3 additions & 3 deletions cirq/google/api/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# limitations under the License.
"""Data format v1 for google api."""

from cirq.google.api.v1 import (
from cirq_google.api.v1 import (
operations_pb2,
params_pb2,
program_pb2,
)

from cirq.google.api.v1.params import sweep_from_proto, sweep_to_proto
from cirq_google.api.v1.params import sweep_from_proto, sweep_to_proto

from cirq.google.api.v1.programs import (
from cirq_google.api.v1.programs import (
gate_to_proto,
is_native_xmon_gate,
is_native_xmon_op,
Expand Down
2 changes: 1 addition & 1 deletion cirq/google/api/v1/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
from typing import cast

from cirq.google.api.v1 import params_pb2
from cirq_google.api.v1 import params_pb2
from cirq.study import sweeps


Expand Down
4 changes: 2 additions & 2 deletions cirq/google/api/v1/params_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import pytest

import cirq
import cirq.google.api.v1.params as params
from cirq.google.api.v1 import params_pb2
import cirq_google.api.v1.params as params
from cirq_google.api.v1 import params_pb2


def test_gen_sweep_points():
Expand Down
4 changes: 2 additions & 2 deletions cirq/google/api/v1/program.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";

import "cirq/google/api/v1/operations.proto";
import "cirq/google/api/v1/params.proto";
import "cirq_google/api/v1/operations.proto";
import "cirq_google/api/v1/params.proto";

package cirq.google.api.v1;

Expand Down
4 changes: 2 additions & 2 deletions cirq/google/api/v1/program_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cirq/google/api/v1/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import sympy

from cirq import devices, ops, protocols, value, circuits
from cirq.google.api.v1 import operations_pb2
from cirq_google.api.v1 import operations_pb2

if TYPE_CHECKING:
import cirq.google
import cirq_google
import cirq


Expand Down Expand Up @@ -168,7 +168,7 @@ def circuit_as_schedule_to_protos(circuit: 'cirq.Circuit') -> Iterator[operation


def circuit_from_schedule_from_protos(
device: 'cirq.google.XmonDevice',
device: 'cirq_google.XmonDevice',
ops: Iterable[operations_pb2.Operation],
) -> 'cirq.Circuit':
"""Convert protos into a Circuit for the given device."""
Expand Down
6 changes: 3 additions & 3 deletions cirq/google/api/v1/programs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import sympy

import cirq
import cirq.google as cg
import cirq.google.api.v1.programs as programs
from cirq.google.api.v1 import operations_pb2
import cirq_google as cg
import cirq_google.api.v1.programs as programs
from cirq_google.api.v1 import operations_pb2


def assert_proto_dict_convert(gate: cirq.Gate, proto: operations_pb2.Operation, *qubits: cirq.Qid):
Expand Down
6 changes: 3 additions & 3 deletions cirq/google/api/v1/proto_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"""Check protobuf modules initialize successfully."""

# pylint: disable=unused-import
from cirq.google.api.v1 import operations_pb2
from cirq.google.api.v1 import params_pb2
from cirq.google.api.v1 import program_pb2
from cirq_google.api.v1 import operations_pb2
from cirq_google.api.v1 import params_pb2
from cirq_google.api.v1 import program_pb2

# pylint: enable=unused-import
8 changes: 4 additions & 4 deletions cirq/google/api/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Data format v2 for google api."""

from cirq.google.api.v2 import (
from cirq_google.api.v2 import (
batch_pb2,
calibration_pb2,
device_pb2,
Expand All @@ -23,15 +23,15 @@
run_context_pb2,
)

from cirq.google.api.v2.program import (
from cirq_google.api.v2.program import (
grid_qubit_from_proto_id,
line_qubit_from_proto_id,
named_qubit_from_proto_id,
qubit_from_proto_id,
qubit_to_proto_id,
)

from cirq.google.api.v2.results import (
from cirq_google.api.v2.results import (
MeasureInfo,
find_measurements,
pack_bits,
Expand All @@ -40,7 +40,7 @@
results_to_proto,
)

from cirq.google.api.v2.sweeps import (
from cirq_google.api.v2.sweeps import (
sweep_from_proto,
sweep_to_proto,
)
6 changes: 3 additions & 3 deletions cirq/google/api/v2/batch.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";

import "cirq/google/api/v2/program.proto";
import "cirq/google/api/v2/result.proto";
import "cirq/google/api/v2/run_context.proto";
import "cirq_google/api/v2/program.proto";
import "cirq_google/api/v2/result.proto";
import "cirq_google/api/v2/run_context.proto";

package cirq.google.api.v2;

Expand Down
6 changes: 3 additions & 3 deletions cirq/google/api/v2/batch_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cirq/google/api/v2/calibration.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";

import "cirq/google/api/v2/metrics.proto";
import "cirq/google/api/v2/program.proto";
import "cirq_google/api/v2/metrics.proto";
import "cirq_google/api/v2/program.proto";

package cirq.google.api.v2;

Expand Down
4 changes: 2 additions & 2 deletions cirq/google/api/v2/calibration_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cirq/google/api/v2/program_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pytest

import cirq
import cirq.google.api.v2 as v2
import cirq_google.api.v2 as v2


def test_qubit_to_proto_id():
Expand Down
8 changes: 4 additions & 4 deletions cirq/google/api/v2/proto_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"""Check protobuf modules initialize successfully."""

# pylint: disable=unused-import
from cirq.google.api.v2 import metrics_pb2
from cirq.google.api.v2 import program_pb2
from cirq.google.api.v2 import result_pb2
from cirq.google.api.v2 import run_context_pb2
from cirq_google.api.v2 import metrics_pb2
from cirq_google.api.v2 import program_pb2
from cirq_google.api.v2 import result_pb2
from cirq_google.api.v2 import run_context_pb2

# pylint: enable=unused-import
2 changes: 1 addition & 1 deletion cirq/google/api/v2/result.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

import "cirq/google/api/v2/program.proto";
import "cirq_google/api/v2/program.proto";

package cirq.google.api.v2;

Expand Down
2 changes: 1 addition & 1 deletion cirq/google/api/v2/result_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cirq/google/api/v2/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import dataclasses
import numpy as np

from cirq.google.api import v2
from cirq.google.api.v2 import result_pb2
from cirq_google.api import v2
from cirq_google.api.v2 import result_pb2
from cirq import circuits
from cirq import devices
from cirq import ops
Expand Down

0 comments on commit 0cd59ea

Please sign in to comment.