Skip to content

Commit 3e35fef

Browse files
authored
Move optimizers/transformer_primitives.py to transformers/transformer_primitives.py (quantumlib#4746)
1 parent b21eef5 commit 3e35fef

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

cirq/__init__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,6 @@
340340
EjectZ,
341341
ExpandComposite,
342342
is_negligible_turn,
343-
map_moments,
344-
map_operations,
345-
map_operations_and_unroll,
346-
merge_moments,
347-
merge_operations,
348343
merge_single_qubit_gates_into_phased_x_z,
349344
merge_single_qubit_gates_into_phxz,
350345
MergeInteractions,
@@ -363,6 +358,14 @@
363358
two_qubit_matrix_to_diagonal_and_operations,
364359
two_qubit_matrix_to_sqrt_iswap_operations,
365360
three_qubit_matrix_to_operations,
361+
)
362+
363+
from cirq.transformers import (
364+
map_moments,
365+
map_operations,
366+
map_operations_and_unroll,
367+
merge_moments,
368+
merge_operations,
366369
unroll_circuit_op,
367370
unroll_circuit_op_greedy_earliest,
368371
unroll_circuit_op_greedy_frontier,

cirq/optimizers/__init__.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,6 @@
9797
three_qubit_matrix_to_operations,
9898
)
9999

100-
from cirq.optimizers.transformer_primitives import (
101-
map_moments,
102-
map_operations,
103-
map_operations_and_unroll,
104-
merge_moments,
105-
merge_operations,
106-
unroll_circuit_op,
107-
unroll_circuit_op_greedy_earliest,
108-
unroll_circuit_op_greedy_frontier,
109-
)
110-
111-
112100
from cirq.optimizers.two_qubit_decompositions import (
113101
two_qubit_matrix_to_operations,
114102
two_qubit_matrix_to_diagonal_and_operations,

cirq/transformers/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2021 The Cirq Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Circuit transformation utilities."""
16+
17+
from cirq.transformers.transformer_primitives import (
18+
map_moments,
19+
map_operations,
20+
map_operations_and_unroll,
21+
merge_moments,
22+
merge_operations,
23+
unroll_circuit_op,
24+
unroll_circuit_op_greedy_earliest,
25+
unroll_circuit_op_greedy_frontier,
26+
)

cirq/optimizers/transformer_primitives_test.py renamed to cirq/transformers/transformer_primitives_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import pytest
1717

1818
import cirq
19-
from cirq.optimizers.transformer_primitives import MAPPED_CIRCUIT_OP_TAG
19+
from cirq.transformers.transformer_primitives import MAPPED_CIRCUIT_OP_TAG
2020

2121

2222
def test_map_operations_can_write_new_gates_inline():

0 commit comments

Comments
 (0)