Skip to content
Draft
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
8 changes: 7 additions & 1 deletion cirq-core/cirq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@
align_left as align_left,
align_right as align_right,
CompilationTargetGateset as CompilationTargetGateset,
CZTargetGateset as CZTargetGateset,
compute_cphase_exponents_for_fsim_decomposition as compute_cphase_exponents_for_fsim_decomposition, # noqa: E501
CPhaseGaugeTransformerMM as CPhaseGaugeTransformerMM,
create_transformer_with_kwargs as create_transformer_with_kwargs,
CZGaugeTransformer as CZGaugeTransformer,
CZTargetGateset as CZTargetGateset,
decompose_clifford_tableau_to_operations as decompose_clifford_tableau_to_operations,
decompose_cphase_into_two_fsim as decompose_cphase_into_two_fsim,
decompose_multi_controlled_x as decompose_multi_controlled_x,
Expand All @@ -372,6 +374,7 @@
HardCodedInitialMapper as HardCodedInitialMapper,
index_tags as index_tags,
is_negligible_turn as is_negligible_turn,
ISWAPGaugeTransformer as ISWAPGaugeTransformer,
LineInitialMapper as LineInitialMapper,
MappingManager as MappingManager,
map_clean_and_borrowable_qubits as map_clean_and_borrowable_qubits,
Expand Down Expand Up @@ -402,6 +405,9 @@
single_qubit_matrix_to_phased_x_z as single_qubit_matrix_to_phased_x_z,
single_qubit_matrix_to_phxz as single_qubit_matrix_to_phxz,
single_qubit_op_to_framed_phase_form as single_qubit_op_to_framed_phase_form,
SpinInversionGaugeTransformer as SpinInversionGaugeTransformer,
SqrtCZGaugeTransformer as SqrtCZGaugeTransformer,
SqrtISWAPGaugeTransformer as SqrtISWAPGaugeTransformer,
stratified_circuit as stratified_circuit,
symbolize_single_qubit_gates_by_indexed_tags as symbolize_single_qubit_gates_by_indexed_tags,
synchronize_terminal_measurements as synchronize_terminal_measurements,
Expand Down
8 changes: 8 additions & 0 deletions cirq-core/cirq/transformers/gauge_compiling/cz_gauge.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import annotations

from cirq import ops
from cirq._doc import document
from cirq.ops.common_gates import CZ
from cirq.transformers.gauge_compiling.gauge_compiling import (
ConstantGauge,
Expand Down Expand Up @@ -46,3 +47,10 @@
)

CZGaugeTransformer = GaugeTransformer(target=CZ, gauge_selector=CZGaugeSelector)
document(
CZGaugeTransformer,
r"""A GaugeTransformer that gauges CZ gates.

Usage: `CZGaugeTransformer(circuit)` will return a new circuit with all CZ gates gauged by the CZGaugeSelector gauge.
""",
)
8 changes: 8 additions & 0 deletions cirq-core/cirq/transformers/gauge_compiling/iswap_gauge.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import numpy as np

from cirq import ops
from cirq._doc import document
from cirq.transformers.gauge_compiling.gauge_compiling import (
ConstantGauge,
Gauge,
Expand Down Expand Up @@ -105,3 +106,10 @@ def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
ISWAPGaugeTransformer = GaugeTransformer(
target=ops.ISWAP, gauge_selector=GaugeSelector(gauges=[RZRotation(), XYRotation()])
)
document(
ISWAPGaugeTransformer,
r"""A GaugeTransformer that gauges ISWAP gates.

Usage: `ISWAPGaugeTransformer(circuit)` will return a new circuit with all ISWAP gates gauged by either the RZRotation gauge or the XYRotation gauge.
""",
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import annotations

from cirq import ops
from cirq._doc import document
from cirq.transformers.gauge_compiling.gauge_compiling import (
GaugeSelector,
GaugeTransformer,
Expand All @@ -33,3 +34,10 @@
SpinInversionGaugeTransformer = GaugeTransformer(
target=ops.GateFamily(ops.ZZPowGate), gauge_selector=SpinInversionGaugeSelector
)
document(
SpinInversionGaugeTransformer,
r"""A GaugeTransformer that gauges gates in the ZZPowGate family by either applying an X gate before and after the two qubits or doing nothing.

Usage: `SpinInversionGaugeTransformer(circuit)` will return a new circuit with all gates in the ZZPowGate family gauged by the gauges.
""",
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from numbers import Real
from typing import TYPE_CHECKING

from cirq._doc import document
from cirq.ops import CZ, CZPowGate, Gate, Gateset, S, X
from cirq.transformers.gauge_compiling.gauge_compiling import (
ConstantGauge,
Expand Down Expand Up @@ -82,3 +83,10 @@ def _symbolize_as_cz_pow(
symbolizer_fn=_symbolize_as_cz_pow, n_symbols=1
),
)
document(
SqrtCZGaugeTransformer,
r"""A GaugeTransformer that gauges CZ**0.5 and CZ**-0.5 gates.

Usage: `SqrtCZGaugeTransformer(circuit)` will return a new circuit with all CZ**0.5 and CZ**-0.5 gates gauged by the SqrtCZGauge gauge.
""",
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import numpy as np

from cirq import ops
from cirq._doc import document
from cirq.transformers.gauge_compiling.gauge_compiling import (
ConstantGauge,
Gauge,
Expand Down Expand Up @@ -95,3 +96,10 @@ def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
SqrtISWAPGaugeTransformer = GaugeTransformer(
target=ops.SQRT_ISWAP, gauge_selector=SqrtISWAPGaugeSelector
)
document(
SqrtISWAPGaugeTransformer,
r"""A GaugeTransformer that gauges SQRT_ISWAP gates.

Usage: `SqrtISWAPGaugeTransformer(circuit)` will return a new circuit with all SQRT_ISWAP gates gauged by either the RZRotation gauge or the XYRotation gauge.
""",
)
Loading