예제 #1
0
def _get_xmon_optimizers_part_cz(
    tolerance: float, tabulation: Optional[cirq.TwoQubitGateTabulation]
) -> List[Callable[[cirq.Circuit], None]]:
    if tabulation is not None:
        # coverage: ignore
        raise ValueError("Gate tabulation not supported for xmon")
    return [
        convert_to_xmon_gates.ConvertToXmonGates().optimize_circuit,
    ]
예제 #2
0
def _get_xmon_optimizers_part_cz(
    tolerance: float, tabulation: Optional[GateTabulation]
) -> List[Callable[[cirq.Circuit], None]]:
    if tabulation is not None:
        # coverage: ignore
        raise ValueError("Gate tabulation not supported for xmon")
    return [
        convert_to_xmon_gates.ConvertToXmonGates().optimize_circuit,
        cirq.MergeInteractions(tolerance=tolerance,
                               allow_partial_czs=True).optimize_circuit,
        lambda c: cirq.merge_single_qubit_gates_into_phxz(c, tolerance),
        *_get_common_cleanup_optimizers(tolerance=tolerance),
    ]
예제 #3
0
 def decompose_operation(self, operation: cirq.Operation) -> cirq.OP_TREE:
     return convert_to_xmon_gates.ConvertToXmonGates().convert(operation)