Skip to content

Commit

Permalink
Move optimizers/transformer_primitives.py to transformers/transformer…
Browse files Browse the repository at this point in the history
…_primitives.py (quantumlib#4746)
  • Loading branch information
tanujkhattar authored and MichaelBroughton committed Jan 22, 2022
1 parent 8c39025 commit 7922380
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 18 deletions.
13 changes: 8 additions & 5 deletions cirq-core/cirq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@
EjectZ,
ExpandComposite,
is_negligible_turn,
map_moments,
map_operations,
map_operations_and_unroll,
merge_moments,
merge_operations,
merge_single_qubit_gates_into_phased_x_z,
merge_single_qubit_gates_into_phxz,
MergeInteractions,
Expand All @@ -362,6 +357,14 @@
two_qubit_matrix_to_diagonal_and_operations,
two_qubit_matrix_to_sqrt_iswap_operations,
three_qubit_matrix_to_operations,
)

from cirq.transformers import (
map_moments,
map_operations,
map_operations_and_unroll,
merge_moments,
merge_operations,
unroll_circuit_op,
unroll_circuit_op_greedy_earliest,
unroll_circuit_op_greedy_frontier,
Expand Down
12 changes: 0 additions & 12 deletions cirq-core/cirq/optimizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,6 @@
three_qubit_matrix_to_operations,
)

from cirq.optimizers.transformer_primitives import (
map_moments,
map_operations,
map_operations_and_unroll,
merge_moments,
merge_operations,
unroll_circuit_op,
unroll_circuit_op_greedy_earliest,
unroll_circuit_op_greedy_frontier,
)


from cirq.optimizers.two_qubit_decompositions import (
two_qubit_matrix_to_operations,
two_qubit_matrix_to_diagonal_and_operations,
Expand Down
26 changes: 26 additions & 0 deletions cirq-core/cirq/transformers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2021 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Circuit transformation utilities."""

from cirq.transformers.transformer_primitives import (
map_moments,
map_operations,
map_operations_and_unroll,
merge_moments,
merge_operations,
unroll_circuit_op,
unroll_circuit_op_greedy_earliest,
unroll_circuit_op_greedy_frontier,
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pytest

import cirq
from cirq.optimizers.transformer_primitives import MAPPED_CIRCUIT_OP_TAG
from cirq.transformers.transformer_primitives import MAPPED_CIRCUIT_OP_TAG


def test_map_operations_can_write_new_gates_inline():
Expand Down

0 comments on commit 7922380

Please sign in to comment.