def __init__(self):
        """
          00 ↔ 01 ↔ 02 ↔ 03 ↔ 04
                ↕         ↕
          05 ↔ 06 ↔ 07 ↔ 08 ↔ 09
           ↕         ↕         ↕
          10 ↔ 11 ↔ 12 ↔ 13 ↔ 14
                ↕         ↕
          15 ↔ 16 ↔ 17 ↔ 18 ↔ 19
        """
        cmap = [[0, 1], [1, 0], [1, 2], [1, 6], [2, 1], [2, 3], [3, 2], [3, 4],
                [3, 8], [4, 3], [5, 6], [5, 10], [6, 1], [6, 5], [6,
                                                                  7], [7, 6],
                [7, 8], [7, 12], [8, 3], [8, 7], [8, 9], [9, 8], [9, 14],
                [10, 5], [10, 11], [11, 10], [11, 12], [11, 16], [12, 7],
                [12, 11], [12, 13], [13, 12], [13, 14], [13, 18], [14, 9],
                [14, 13], [15, 16], [16, 11], [16, 15], [16, 17], [17, 16],
                [17, 18], [18, 13], [18, 17], [18, 19], [19, 18]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_boeblingen',
            backend_version='0.0.0',
            n_qubits=20,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=True,
            max_shots=8192,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #2
0
    def __init__(self):
        """
         1 →  2 →  3 →  4 ←  5 ←  6 →  7 ← 8
         ↓    ↑    ↓    ↓    ↑    ↓    ↓   ↑
         0 ← 15 → 14 ← 13 ← 12 → 11 → 10 ← 9
        """
        cmap = [[1, 0], [1, 2], [2, 3], [3, 4], [3, 14], [5, 4], [6,
                                                                  5], [6, 7],
                [6, 11], [7, 10], [8, 7], [9, 8], [9, 10], [11, 10], [12, 5],
                [12, 11], [12, 13], [13, 4], [13, 14], [15, 0], [15, 2],
                [15, 14]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_rueschlikon',
            backend_version='0.0.0',
            n_qubits=16,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            max_experiments=900,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #3
0
    def __init__(self):
        cmap = [[0, 1], [0, 5], [1, 0], [1, 2], [2, 1], [2, 3], [3, 2], [3, 4],
                [4, 3], [4, 9], [5, 0], [5, 6], [5, 10], [6, 5], [6,
                                                                  7], [7, 6],
                [7, 8], [7, 12], [8, 7], [8, 9], [9, 4], [9, 8], [9, 14],
                [10, 5], [10, 11], [10, 15], [11, 10], [11, 12], [12, 7],
                [12, 11], [12, 13], [13, 12], [13, 14], [14, 9], [14, 13],
                [14, 19], [15, 10], [15, 16], [16, 15], [16, 17], [17, 16],
                [17, 18], [18, 17], [18, 19], [19, 14], [19, 18]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_poughkeepsie',
            backend_version='0.0.0',
            n_qubits=20,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=True,
            max_shots=8192,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #4
0
    def __init__(self):
        """
        0  -  1  -  2  -  3  -  4  -  5  -  6

              |     |     |     |     |     |

              13 -  12  - 11 -  10 -  9  -  8  -   7
        """
        cmap = [[1, 0], [1, 2], [2, 3], [4, 3], [4, 10], [5, 4],
                [5, 6], [5, 9], [6, 8], [7, 8], [9, 8], [9, 10],
                [11, 3], [11, 10], [11, 12], [12, 2], [13, 1], [13, 12]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_melbourne',
            backend_version='0.0.0',
            n_qubits=14,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #5
0
    def __init__(self):
        """
            1
          / |
        0 - 2 - 3
            | /
            4
        """
        cmap = [[1, 0], [2, 0], [2, 1], [3, 2], [3, 4], [4, 2]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_tenerife',
            backend_version='0.0.0',
            n_qubits=5,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #6
0
    def __init__(self):
        """

        .. code-block:: text

                1
              ↙ ↑
            0 ← 2 ← 3
                ↑ ↙
                4
        """
        cmap = [[1, 0], [2, 0], [2, 1], [3, 2], [3, 4], [4, 2]]

        configuration = QasmBackendConfiguration(
            backend_name="fake_tenerife",
            backend_version="0.0.0",
            n_qubits=5,
            basis_gates=["u1", "u2", "u3", "cx", "id"],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            max_experiments=900,
            gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #7
0
    def __init__(self):
        """
         0 ↔ 1 ↔ 3 ↔ 4
             ↕
             2
        """
        cmap = [[0, 1], [1, 0], [1, 2], [1, 3], [2, 1], [3, 1], [3, 4], [4, 3]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_ourense',
            backend_version='0.0.0',
            n_qubits=5,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            max_experiments=900,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #8
0
    def __init__(self):
        """
         0 ← 1 →  2 →  3 ←  4 ← 5 → 6
             ↑    ↑    ↑    ↓   ↓   ↓
            13 → 12 ← 11 → 10 ← 9 → 8 ← 7
        """
        cmap = [[1, 0], [1, 2], [2, 3], [4, 3], [4, 10], [5, 4], [5, 6],
                [5, 9], [6, 8], [7, 8], [9, 8], [9, 10], [11, 3], [11, 10],
                [11, 12], [12, 2], [13, 1], [13, 12]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_melbourne',
            backend_version='0.0.0',
            n_qubits=14,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            max_experiments=900,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #9
0
    def __init__(self):
        """
        1  -  2  -  3  -  4  -  5  -  6  -  7   -  8

        |     |     |     |     |     |     |      |

        0  -  15 -  14 -  13 -  12 -  11 -  10  -  9
        """
        cmap = [[1, 0], [1, 2], [2, 3], [3, 4], [3, 14], [5, 4], [6, 5],
                [6, 7], [6, 11], [7, 10], [8, 7], [9, 8], [9, 10],
                [11, 10], [12, 5], [12, 11], [12, 13], [13, 4],
                [13, 14], [15, 0], [15, 2], [15, 14]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_rueschlikon',
            backend_version='0.0.0',
            n_qubits=16,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #10
0
    def __init__(self):
        """

        .. code-block:: text

            1 →  2 →  3 →  4 ←  5 ←  6 →  7 ← 8
            ↓    ↑    ↓    ↓    ↑    ↓    ↓   ↑
            0 ← 15 → 14 ← 13 ← 12 → 11 → 10 ← 9
        """
        cmap = [
            [1, 0],
            [1, 2],
            [2, 3],
            [3, 4],
            [3, 14],
            [5, 4],
            [6, 5],
            [6, 7],
            [6, 11],
            [7, 10],
            [8, 7],
            [9, 8],
            [9, 10],
            [11, 10],
            [12, 5],
            [12, 11],
            [12, 13],
            [13, 4],
            [13, 14],
            [15, 0],
            [15, 2],
            [15, 14],
        ]

        configuration = QasmBackendConfiguration(
            backend_name="fake_rueschlikon",
            backend_version="0.0.0",
            n_qubits=16,
            basis_gates=["u1", "u2", "u3", "cx", "id"],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            max_experiments=900,
            gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
            coupling_map=cmap,
        )

        super().__init__(configuration)
def gate_name_2_gate_config(gate_name: str):
    gate = get_qiskit_gate(gate_name)

    signature = inspect.signature(gate.__init__)
    parameters = [
        p for p, v in signature.parameters.items()
        if p != 'self' and v.default == inspect.Parameter.empty
    ]
    documentation = gate._define.__doc__ if hasattr(gate, '_define') else None
    gate_config = GateConfig(
        gate_name,
        parameters=parameters,
        qasm_def=documentation.strip() if documentation else None)
    return gate_config
예제 #12
0
    def __init__(self):
        """

        .. code-block:: text

            0 ← 1 →  2 →  3 ←  4 ← 5 → 6
                ↑    ↑    ↑    ↓   ↓   ↓
               13 → 12 ← 11 → 10 ← 9 → 8 ← 7
        """
        cmap = [
            [1, 0],
            [1, 2],
            [2, 3],
            [4, 3],
            [4, 10],
            [5, 4],
            [5, 6],
            [5, 9],
            [6, 8],
            [7, 8],
            [9, 8],
            [9, 10],
            [11, 3],
            [11, 10],
            [11, 12],
            [12, 2],
            [13, 1],
            [13, 12],
        ]

        configuration = QasmBackendConfiguration(
            backend_name="fake_melbourne",
            backend_version="0.0.0",
            n_qubits=14,
            basis_gates=["u1", "u2", "u3", "cx", "id"],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            max_experiments=900,
            gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #13
0
 def convert_to_qiskit_hardware(self):
     configuration = QasmBackendConfiguration(
         backend_name=self.name,
         backend_version="0.0.0",
         n_qubits=self.num_qubits,
         basis_gates=["u1", "u2", "u3", "cx", "id"],  # TODO check gate sets
         simulator=False,
         local=True,
         conditional=False,
         open_pulse=False,
         memory=False,
         max_shots=65536,
         gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
         coupling_map=self.qubit_connectivity.get_coupling_map(),
     )
     hardware = FakeBackend(configuration)
     return hardware
예제 #14
0
    def __init__(self):
        configuration = QasmBackendConfiguration(
            backend_name='fake_qasm_simulator',
            backend_version='0.0.0',
            n_qubits=5,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id', 'unitary'],
            coupling_map=None,
            simulator=True,
            local=True,
            conditional=True,
            open_pulse=False,
            memory=True,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')]
        )

        super().__init__(configuration)
예제 #15
0
    def __init__(self):
        """
        0  =  1   =  2   =  3     4

        ||    ||    ||     ||  X  ||

        5  =  6   =  7   =  8  =  9

        || X  ||    ||   X  ||

        10 =  11  =  12  =  13 =  14

        ||    ||  X         || X  ||

        15 =  16  =  17     18    19
        """
        cmap = [[0, 1], [0, 5], [1, 0], [1, 2], [1, 6], [2, 1],
                [2, 3], [2, 6], [3, 2], [3, 8], [3, 9], [4, 8], [4, 9],
                [5, 0], [5, 6], [5, 10], [5, 11], [6, 1], [6, 2], [6, 5],
                [6, 7], [6, 10], [6, 11], [7, 1], [7, 6], [7, 8], [7, 12],
                [7, 13], [8, 3], [8, 4], [8, 7], [8, 9], [8, 12], [8, 13],
                [9, 3], [9, 4], [9, 8], [10, 5], [10, 6], [10, 11], [10, 15],
                [11, 5], [11, 6], [11, 10], [11, 12], [11, 16], [11, 17],
                [12, 7], [12, 8], [12, 11], [12, 13], [12, 16], [13, 7],
                [13, 8], [13, 12], [13, 14], [13, 18], [13, 19], [14, 13],
                [14, 18], [14, 19], [15, 10], [15, 16], [16, 11], [16, 12],
                [16, 15], [16, 17], [17, 11], [17, 16], [18, 13], [18, 14],
                [19, 13], [19, 14]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_tokyo',
            backend_version='0.0.0',
            n_qubits=20,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #16
0
 def from_name(cls, backend_name: str,
               provider: 'accountprovider.AccountProvider',
               credentials: Credentials,
               api: AccountClient) -> 'IBMQRetiredBackend':
     """Return a retired backend from its name."""
     configuration = BackendConfiguration(
         backend_name=backend_name,
         backend_version='0.0.0',
         n_qubits=1,
         basis_gates=[],
         simulator=False,
         local=False,
         conditional=False,
         open_pulse=False,
         memory=False,
         max_shots=1,
         gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
         coupling_map=[[0, 1]],
     )
     return cls(configuration, provider, credentials, api)
    def __init__(self):
        configuration = QasmBackendConfiguration(
            backend_name="fake_qasm_simulator",
            backend_version="0.0.0",
            n_qubits=5,
            basis_gates=["u1", "u2", "u3", "cx", "id", "unitary"],
            coupling_map=None,
            simulator=True,
            local=True,
            conditional=True,
            open_pulse=False,
            memory=True,
            max_shots=65536,
            gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
            dt=1.3333,
            dtm=10.5,
            qubit_lo_range=[[4.95, 5.05], [4.95, 5.05], [4.95, 5.05], [4.95, 5.05], [4.95, 5.05]],
            meas_lo_range=[[6.65, 6.75], [6.65, 6.75], [6.65, 6.75], [6.65, 6.75], [6.65, 6.75]],
        )

        super().__init__(configuration)
예제 #18
0
    def __init__(self):
        cmap = [[0, 5], [0, 1], [1, 2], [1, 0], [2, 3], [2, 1], [3, 4], [3, 2],
                [4, 6], [4, 3], [5, 9], [5, 0], [6, 13], [6, 4], [7, 16],
                [7, 8], [8, 9], [8, 7], [9, 10], [9, 8], [9, 5], [10, 11],
                [10, 9], [11, 17], [11, 12], [11, 10], [12, 13], [12, 11],
                [13, 14], [13, 12], [13, 6], [14, 15], [14, 13], [15, 18],
                [15, 14], [16, 19], [16, 7], [17, 23], [17, 11], [18, 27],
                [18, 15], [19, 20], [19, 16], [20, 21], [20, 19], [21, 28],
                [21, 22], [21, 20], [22, 23], [22, 21], [23, 24], [23, 22],
                [23, 17], [24, 25], [24, 23], [25, 29], [25, 26], [25, 24],
                [26, 27], [26, 25], [27, 26], [27, 18], [28, 32], [28, 21],
                [29, 36], [29, 25], [30, 39], [30, 31], [31, 32], [31, 30],
                [32, 33], [32, 31], [32, 28], [33, 34], [33, 32], [34, 40],
                [34, 35], [34, 33], [35, 36], [35, 34], [36, 37], [36, 35],
                [36, 29], [37, 38], [37, 36], [38, 41], [38, 37], [39, 42],
                [39, 30], [40, 46], [40, 34], [41, 50], [41, 38], [42, 43],
                [42, 39], [43, 44], [43, 42], [44, 51], [44, 45], [44, 43],
                [45, 46], [45, 44], [46, 47], [46, 45], [46, 40], [47, 48],
                [47, 46], [48, 52], [48, 49], [48, 47], [49, 50], [49, 48],
                [50, 49], [50, 41], [51, 44], [52, 48]]

        configuration = QasmBackendConfiguration(
            backend_name='fake_rochester',
            backend_version='0.0.0',
            n_qubits=53,
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=True,
            max_shots=8192,
            max_experiments=900,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=cmap,
        )

        super().__init__(configuration)
예제 #19
0
 def from_name(
     cls,
     backend_name: str,
     provider: "ibm_provider.IBMProvider",
     api: AccountClient,
 ) -> "IBMRetiredBackend":
     """Return a retired backend from its name."""
     configuration = QasmBackendConfiguration(
         backend_name=backend_name,
         backend_version="0.0.0",
         online_date="2019-10-16T04:00:00Z",
         n_qubits=1,
         basis_gates=[],
         simulator=False,
         local=False,
         conditional=False,
         open_pulse=False,
         memory=False,
         max_shots=1,
         gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
         coupling_map=[[0, 1]],
         max_experiments=300,
     )
     return cls(configuration, provider, api)
예제 #20
0
    def __init__(self):
        configuration = PulseBackendConfiguration(
            backend_name='fake_openpulse_2q',
            backend_version='0.0.0',
            n_qubits=2,
            meas_levels=[0, 1, 2],
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=True,
            open_pulse=True,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=[[0, 1]],
            n_registers=2,
            n_uchannels=2,
            u_channel_lo=[
                [UchannelLO(q=0, scale=1. + 0.j)],
                [UchannelLO(q=0, scale=-1. + 0.j), UchannelLO(q=1, scale=1. + 0.j)]
            ],
            qubit_lo_range=[[4.5, 5.5], [4.5, 5.5]],
            meas_lo_range=[[6.0, 7.0], [6.0, 7.0]],
            dt=1.3333,
            dtm=10.5,
            rep_times=[100, 250, 500, 1000],
            meas_map=[[0, 1]],
            channel_bandwidth=[
                [-0.2, 0.4], [-0.3, 0.3], [-0.3, 0.3],
                [-0.02, 0.02], [-0.02, 0.02], [-0.02, 0.02]
            ],
            meas_kernels=['kernel1'],
            discriminators=['max_1Q_fidelity'],
            acquisition_latency=[[100, 100], [100, 100]],
            conditional_latency=[
                [100, 1000], [1000, 100], [100, 1000],
                [1000, 100], [100, 1000], [1000, 100]
            ],
            hamiltonian={
                'h_str': ["np.pi*(2*v0-alpha0)*O0", "np.pi*alpha0*O0*O0", "2*np.pi*r*X0||D0",
                          "2*np.pi*r*X0||U1", "2*np.pi*r*X1||U0", "np.pi*(2*v1-alpha1)*O1",
                          "np.pi*alpha1*O1*O1", "2*np.pi*r*X1||D1", "2*np.pi*j*(Sp0*Sm1+Sm0*Sp1)"],
                'description': "A hamiltonian for a mocked 2Q device, with 1Q and 2Q terms.",
                'qub': {'0': 3, '1': 3},
                'vars':  {'v0': 5.00,
                          'v1': 5.1,
                          'j': 0.01,
                          'r': 0.02,
                          'alpha0': -0.33,
                          'alpha1': -0.33}
            },
            channels={
                'acquire0': {
                    'operates': {'qubits': [0]},
                    'purpose': 'acquire',
                    'type': 'acquire'
                },
                'acquire1': {
                    'operates': {'qubits': [1]},
                    'purpose': 'acquire',
                    'type': 'acquire'
                },
                'd0': {
                    'operates': {'qubits': [0]},
                    'purpose': 'drive',
                    'type': 'drive'
                },
                'd1': {
                    'operates': {'qubits': [1]},
                    'purpose': 'drive',
                    'type': 'drive'
                },
                'm0': {
                    'type': 'measure',
                    'purpose': 'measure',
                    'operates': {'qubits': [0]}
                },
                'm1': {
                    'type': 'measure',
                    'purpose': 'measure',
                    'operates': {'qubits': [1]}
                },
                'u0': {
                    'operates': {'qubits': [0, 1]},
                    'purpose': 'cross-resonance',
                    'type': 'control'
                },
                'u1': {
                    'operates': {'qubits': [1, 0]},
                    'purpose': 'cross-resonance',
                    'type': 'control'
                }
            }
        )

        self._defaults = PulseDefaults.from_dict({
            'qubit_freq_est': [4.9, 5.0],
            'meas_freq_est': [6.5, 6.6],
            'buffer': 10,
            'pulse_library': [
                {
                    'name': 'test_pulse_1',
                    'samples': [[0.0, 0.0], [0.0, 0.1]]
                },
                {
                    'name': 'test_pulse_2',
                    'samples': [[0.0, 0.0], [0.0, 0.1], [0.0, 1.0]]
                },
                {
                    'name': 'test_pulse_3',
                    'samples': [[0.0, 0.0], [0.0, 0.1], [0.0, 1.0], [0.5, 0.0]]
                },
                {
                    'name': 'test_pulse_4',
                    'samples': 7 * [
                        [0.0, 0.0], [0.0, 0.1], [0.0, 1.0], [0.5, 0.0]
                    ]
                }
            ],
            'cmd_def': [
                Command.from_dict({
                    'name': 'u1',
                    'qubits': [0],
                    'sequence': [
                        PulseQobjInstruction(name='fc', ch='d0',
                                             t0=0, phase='-P0').to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'u1',
                    'qubits': [1],
                    'sequence': [
                        PulseQobjInstruction(name='fc', ch='d1',
                                             t0=0, phase='-P0').to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'u2',
                    'qubits': [0],
                    'sequence': [
                        PulseQobjInstruction(name='fc', ch='d0',
                                             t0=0,
                                             phase='-P1').to_dict(),
                        PulseQobjInstruction(name='test_pulse_4', ch='d0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='fc', ch='d0', t0=0,
                                             phase='-P0').to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'u2',
                    'qubits': [1],
                    'sequence': [
                        PulseQobjInstruction(name='fc', ch='d1', t0=0,
                                             phase='-P1').to_dict(),
                        PulseQobjInstruction(name='test_pulse_4',
                                             ch='d1', t0=0).to_dict(),
                        PulseQobjInstruction(name='fc', ch='d1',
                                             t0=0, phase='-P0').to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'u3',
                    'qubits': [0],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1', ch='d0',
                                             t0=0).to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'u3',
                    'qubits': [1],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_3', ch='d1',
                                             t0=0).to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'cx',
                    'qubits': [0, 1],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1', ch='d0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_2', ch='u0',
                                             t0=10).to_dict(),
                        PulseQobjInstruction(name='test_pulse_1', ch='d1',
                                             t0=20).to_dict(),
                        PulseQobjInstruction(name='fc', ch='d1',
                                             t0=20, phase=2.1).to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'ParametrizedGate',
                    'qubits': [0, 1],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1', ch='d0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_2', ch='u0',
                                             t0=10).to_dict(),
                        PulseQobjInstruction(name='pv', ch='d1',
                                             t0=2, val='cos(P2)').to_dict(),
                        PulseQobjInstruction(name='test_pulse_1', ch='d1',
                                             t0=20).to_dict(),
                        PulseQobjInstruction(name='fc', ch='d1',
                                             t0=20, phase=2.1).to_dict()
                    ]}).to_dict(),
                Command.from_dict({
                    'name': 'measure',
                    'qubits': [0, 1],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1', ch='m0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_1', ch='m1',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='acquire', duration=10, t0=0,
                                             qubits=[0, 1],
                                             memory_slot=[0, 1]).to_dict()
                    ]}).to_dict()
            ]
        })

        mock_time = datetime.datetime.now()
        dt = 1.3333  # pylint: disable=invalid-name
        self._properties = BackendProperties(
            backend_name='fake_openpulse_2q',
            backend_version='0.0.0',
            last_update_date=mock_time,
            qubits=[
                [Nduv(date=mock_time, name='T1', unit='µs', value=71.9500421005539),
                 Nduv(date=mock_time, name='frequency', unit='MHz', value=4919.96800692)],
                [Nduv(date=mock_time, name='T1', unit='µs', value=81.9500421005539),
                 Nduv(date=mock_time, name='frequency', unit='GHz', value=5.01996800692)]
            ],
            gates=[
                Gate(gate='u1', qubits=[0],
                     parameters=[
                         Nduv(date=mock_time, name='gate_error', unit='', value=0.06),
                         Nduv(date=mock_time, name='gate_length', unit='ns', value=0.)]),
                Gate(gate='u3', qubits=[0],
                     parameters=[
                         Nduv(date=mock_time, name='gate_error', unit='', value=0.06),
                         Nduv(date=mock_time, name='gate_length', unit='ns', value=2 * dt)]),
                Gate(gate='u3', qubits=[1],
                     parameters=[
                         Nduv(date=mock_time, name='gate_error', unit='', value=0.06),
                         Nduv(date=mock_time, name='gate_length', unit='ns', value=4 * dt)]),
                Gate(gate='cx', qubits=[0, 1],
                     parameters=[
                         Nduv(date=mock_time, name='gate_error', unit='', value=1.0),
                         Nduv(date=mock_time, name='gate_length', unit='ns', value=22 * dt)]),
            ],
            general=[]
        )

        super().__init__(configuration)
예제 #21
0
    def __init__(self):
        configuration = PulseBackendConfiguration(
            backend_name='fake_openpulse_2q',
            backend_version='0.0.0',
            n_qubits=2,
            meas_levels=[0, 1, 2],
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=True,
            open_pulse=True,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=[[0, 1]],
            n_registers=2,
            n_uchannels=2,
            u_channel_lo=[[UchannelLO(q=0, scale=1. + 0.j)],
                          [
                              UchannelLO(q=0, scale=-1. + 0.j),
                              UchannelLO(q=1, scale=1. + 0.j)
                          ]],
            meas_level=[1, 2],
            qubit_lo_range=[[4.5, 5.5], [4.5, 5.5]],
            meas_lo_range=[[6.0, 7.0], [6.0, 7.0]],
            dt=1.3333,
            dtm=10.5,
            rep_times=[100, 250, 500, 1000],
            meas_map=[[0, 1]],
            channel_bandwidth=[[-0.2, 0.4], [-0.3, 0.3], [-0.3, 0.3],
                               [-0.02, 0.02], [-0.02, 0.02], [-0.02, 0.02]],
            meas_kernels=['kernel1'],
            discriminators=['max_1Q_fidelity'],
            acquisition_latency=[[100, 100], [100, 100]],
            conditional_latency=[[100, 1000], [1000, 100], [100, 1000],
                                 [1000, 100], [100, 1000], [1000, 100]])

        self._defaults = PulseDefaults(
            qubit_freq_est=[4.9, 5.0],
            meas_freq_est=[6.5, 6.6],
            buffer=10,
            pulse_library=[
                PulseLibraryItem(name='test_pulse_1', samples=[0.j, 0.1j]),
                PulseLibraryItem(name='test_pulse_2', samples=[0.j, 0.1j, 1j]),
                PulseLibraryItem(name='test_pulse_3',
                                 samples=[0.j, 0.1j, 1j, 0.5 + 0j]),
                PulseLibraryItem(name='test_pulse_4',
                                 samples=7 * [0.j, 0.1j, 1j, 0.5 + 0j])
            ],
            cmd_def=[
                Command(name='u1',
                        qubits=[0],
                        sequence=[
                            PulseQobjInstruction(name='fc',
                                                 ch='d0',
                                                 t0=0,
                                                 phase='-P1*np.pi')
                        ]),
                Command(name='u1',
                        qubits=[1],
                        sequence=[
                            PulseQobjInstruction(name='fc',
                                                 ch='d1',
                                                 t0=0,
                                                 phase='-P1*np.pi')
                        ]),
                Command(name='u2',
                        qubits=[0],
                        sequence=[
                            PulseQobjInstruction(name='fc',
                                                 ch='d0',
                                                 t0=0,
                                                 phase='-P0*np.pi'),
                            PulseQobjInstruction(name='test_pulse_4',
                                                 ch='d0',
                                                 t0=0),
                            PulseQobjInstruction(name='fc',
                                                 ch='d0',
                                                 t0=0,
                                                 phase='-P1*np.pi')
                        ]),
                Command(name='u2',
                        qubits=[1],
                        sequence=[
                            PulseQobjInstruction(name='fc',
                                                 ch='d1',
                                                 t0=0,
                                                 phase='-P0*np.pi'),
                            PulseQobjInstruction(name='test_pulse_4',
                                                 ch='d1',
                                                 t0=0),
                            PulseQobjInstruction(name='fc',
                                                 ch='d1',
                                                 t0=0,
                                                 phase='-P0*np.pi')
                        ]),
                Command(name='u3',
                        qubits=[0],
                        sequence=[
                            PulseQobjInstruction(name='test_pulse_1',
                                                 ch='d0',
                                                 t0=0)
                        ]),
                Command(name='u3',
                        qubits=[1],
                        sequence=[
                            PulseQobjInstruction(name='test_pulse_3',
                                                 ch='d1',
                                                 t0=0)
                        ]),
                Command(name='cx',
                        qubits=[0, 1],
                        sequence=[
                            PulseQobjInstruction(name='test_pulse_1',
                                                 ch='d0',
                                                 t0=0),
                            PulseQobjInstruction(name='test_pulse_2',
                                                 ch='u0',
                                                 t0=10),
                            PulseQobjInstruction(name='test_pulse_1',
                                                 ch='d1',
                                                 t0=20),
                            PulseQobjInstruction(name='fc',
                                                 ch='d1',
                                                 t0=20,
                                                 phase=2.1)
                        ]),
                Command(name='ParametrizedGate',
                        qubits=[0, 1],
                        sequence=[
                            PulseQobjInstruction(name='test_pulse_1',
                                                 ch='d0',
                                                 t0=0),
                            PulseQobjInstruction(name='test_pulse_2',
                                                 ch='u0',
                                                 t0=10),
                            PulseQobjInstruction(name='pv',
                                                 ch='d1',
                                                 t0=2,
                                                 val='cos(P2)'),
                            PulseQobjInstruction(name='test_pulse_1',
                                                 ch='d1',
                                                 t0=20),
                            PulseQobjInstruction(name='fc',
                                                 ch='d1',
                                                 t0=20,
                                                 phase=2.1)
                        ]),
                Command(name='measure',
                        qubits=[0, 1],
                        sequence=[
                            PulseQobjInstruction(name='test_pulse_1',
                                                 ch='m0',
                                                 t0=0),
                            PulseQobjInstruction(name='test_pulse_1',
                                                 ch='m1',
                                                 t0=0),
                            PulseQobjInstruction(name='acquire',
                                                 duration=10,
                                                 t0=0,
                                                 qubits=[0, 1],
                                                 memory_slot=[0, 1])
                        ])
            ])

        mock_time = datetime.datetime.now()
        dt = 1.3333  # pylint: disable=invalid-name
        self._properties = BackendProperties(
            backend_name='fake_openpulse_2q',
            backend_version='0.0.0',
            last_update_date=mock_time,
            qubits=[[
                Nduv(date=mock_time,
                     name='T1',
                     unit='µs',
                     value=71.9500421005539),
                Nduv(date=mock_time,
                     name='frequency',
                     unit='MHz',
                     value=4919.96800692)
            ],
                    [
                        Nduv(date=mock_time,
                             name='T1',
                             unit='µs',
                             value=81.9500421005539),
                        Nduv(date=mock_time,
                             name='frequency',
                             unit='GHz',
                             value=5.01996800692)
                    ]],
            gates=[
                Gate(gate='u1',
                     name='u1_0',
                     qubits=[0],
                     parameters=[
                         Nduv(date=mock_time,
                              name='gate_error',
                              unit='',
                              value=1.0),
                         Nduv(date=mock_time,
                              name='gate_length',
                              unit='ns',
                              value=0.)
                     ]),
                Gate(gate='u3',
                     name='u3_0',
                     qubits=[0],
                     parameters=[
                         Nduv(date=mock_time,
                              name='gate_error',
                              unit='',
                              value=1.0),
                         Nduv(date=mock_time,
                              name='gate_length',
                              unit='ns',
                              value=2 * dt)
                     ]),
                Gate(gate='u3',
                     name='u3_1',
                     qubits=[1],
                     parameters=[
                         Nduv(date=mock_time,
                              name='gate_error',
                              unit='',
                              value=1.0),
                         Nduv(date=mock_time,
                              name='gate_length',
                              unit='ns',
                              value=4 * dt)
                     ]),
                Gate(gate='cx',
                     name='cx0_1',
                     qubits=[0, 1],
                     parameters=[
                         Nduv(date=mock_time,
                              name='gate_error',
                              unit='',
                              value=1.0),
                         Nduv(date=mock_time,
                              name='gate_length',
                              unit='ns',
                              value=22 * dt)
                     ]),
            ],
            general=[])

        super().__init__(configuration)
예제 #22
0
    def __init__(self):
        configuration = PulseBackendConfiguration(
            backend_name="fake_openpulse_2q",
            backend_version="0.0.0",
            n_qubits=2,
            meas_levels=[0, 1, 2],
            basis_gates=["u1", "u2", "u3", "cx", "id"],
            simulator=False,
            local=True,
            conditional=True,
            open_pulse=True,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
            coupling_map=[[0, 1]],
            n_registers=2,
            n_uchannels=2,
            u_channel_lo=[
                [UchannelLO(q=0, scale=1.0 + 0.0j)],
                [
                    UchannelLO(q=0, scale=-1.0 + 0.0j),
                    UchannelLO(q=1, scale=1.0 + 0.0j)
                ],
            ],
            qubit_lo_range=[[4.5, 5.5], [4.5, 5.5]],
            meas_lo_range=[[6.0, 7.0], [6.0, 7.0]],
            dt=1.3333,
            dtm=10.5,
            rep_times=[100, 250, 500, 1000],
            meas_map=[[0, 1]],
            channel_bandwidth=[
                [-0.2, 0.4],
                [-0.3, 0.3],
                [-0.3, 0.3],
                [-0.02, 0.02],
                [-0.02, 0.02],
                [-0.02, 0.02],
            ],
            meas_kernels=["kernel1"],
            discriminators=["max_1Q_fidelity"],
            acquisition_latency=[[100, 100], [100, 100]],
            conditional_latency=[
                [100, 1000],
                [1000, 100],
                [100, 1000],
                [1000, 100],
                [100, 1000],
                [1000, 100],
            ],
            hamiltonian={
                "h_str": [
                    "np.pi*(2*v0-alpha0)*O0",
                    "np.pi*alpha0*O0*O0",
                    "2*np.pi*r*X0||D0",
                    "2*np.pi*r*X0||U1",
                    "2*np.pi*r*X1||U0",
                    "np.pi*(2*v1-alpha1)*O1",
                    "np.pi*alpha1*O1*O1",
                    "2*np.pi*r*X1||D1",
                    "2*np.pi*j*(Sp0*Sm1+Sm0*Sp1)",
                ],
                "description":
                "A hamiltonian for a mocked 2Q device, with 1Q and 2Q terms.",
                "qub": {
                    "0": 3,
                    "1": 3
                },
                "vars": {
                    "v0": 5.00,
                    "v1": 5.1,
                    "j": 0.01,
                    "r": 0.02,
                    "alpha0": -0.33,
                    "alpha1": -0.33,
                },
            },
            channels={
                "acquire0": {
                    "operates": {
                        "qubits": [0]
                    },
                    "purpose": "acquire",
                    "type": "acquire"
                },
                "acquire1": {
                    "operates": {
                        "qubits": [1]
                    },
                    "purpose": "acquire",
                    "type": "acquire"
                },
                "d0": {
                    "operates": {
                        "qubits": [0]
                    },
                    "purpose": "drive",
                    "type": "drive"
                },
                "d1": {
                    "operates": {
                        "qubits": [1]
                    },
                    "purpose": "drive",
                    "type": "drive"
                },
                "m0": {
                    "type": "measure",
                    "purpose": "measure",
                    "operates": {
                        "qubits": [0]
                    }
                },
                "m1": {
                    "type": "measure",
                    "purpose": "measure",
                    "operates": {
                        "qubits": [1]
                    }
                },
                "u0": {
                    "operates": {
                        "qubits": [0, 1]
                    },
                    "purpose": "cross-resonance",
                    "type": "control",
                },
                "u1": {
                    "operates": {
                        "qubits": [1, 0]
                    },
                    "purpose": "cross-resonance",
                    "type": "control",
                },
            },
            processor_type={
                "family": "Canary",
                "revision": "1.0",
                "segment": "A",
            },
        )

        self._defaults = PulseDefaults.from_dict({
            "qubit_freq_est": [4.9, 5.0],
            "meas_freq_est": [6.5, 6.6],
            "buffer":
            10,
            "pulse_library": [
                {
                    "name": "x90p_d0",
                    "samples": 2 * [0.1 + 0j]
                },
                {
                    "name": "x90p_d1",
                    "samples": 2 * [0.1 + 0j]
                },
                {
                    "name": "x90m_d0",
                    "samples": 2 * [-0.1 + 0j]
                },
                {
                    "name": "x90m_d1",
                    "samples": 2 * [-0.1 + 0j]
                },
                {
                    "name": "y90p_d0",
                    "samples": 2 * [0.1j]
                },
                {
                    "name": "y90p_d1",
                    "samples": 2 * [0.1j]
                },
                {
                    "name": "xp_d0",
                    "samples": 2 * [0.2 + 0j]
                },
                {
                    "name": "ym_d0",
                    "samples": 2 * [-0.2j]
                },
                {
                    "name": "cr90p_u0",
                    "samples": 9 * [0.1 + 0j]
                },
                {
                    "name": "cr90m_u0",
                    "samples": 9 * [-0.1 + 0j]
                },
                {
                    "name": "measure_m0",
                    "samples": 10 * [0.1 + 0j]
                },
                {
                    "name": "measure_m1",
                    "samples": 10 * [0.1 + 0j]
                },
            ],
            "cmd_def": [
                Command.from_dict({
                    "name":
                    "u1",
                    "qubits": [0],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase="-P0").to_dict()
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u1",
                    "qubits": [1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=0,
                                             phase="-P0").to_dict()
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u2",
                    "qubits": [0],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase="-P1").to_dict(),
                        PulseQobjInstruction(name="y90p_d0", ch="d0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=2,
                                             phase="-P0").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u2",
                    "qubits": [1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=0,
                                             phase="-P1").to_dict(),
                        PulseQobjInstruction(name="y90p_d1", ch="d1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=2,
                                             phase="-P0").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u3",
                    "qubits": [0],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase="-P2").to_dict(),
                        PulseQobjInstruction(name="x90p_d0", ch="d0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=2,
                                             phase="-P0").to_dict(),
                        PulseQobjInstruction(name="x90m_d0", ch="d0",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=4,
                                             phase="-P1").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u3",
                    "qubits": [1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=0,
                                             phase="-P2").to_dict(),
                        PulseQobjInstruction(name="x90p_d1", ch="d1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=2,
                                             phase="-P0").to_dict(),
                        PulseQobjInstruction(name="x90m_d1", ch="d1",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=4,
                                             phase="-P1").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "cx",
                    "qubits": [0, 1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase=1.57).to_dict(),
                        PulseQobjInstruction(name="ym_d0", ch="d0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="xp_d0", ch="d0",
                                             t0=11).to_dict(),
                        PulseQobjInstruction(name="x90p_d1", ch="d1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="cr90p_u0", ch="u0",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="cr90m_u0", ch="u0",
                                             t0=13).to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "measure",
                    "qubits": [0, 1],
                    "sequence": [
                        PulseQobjInstruction(name="measure_m0", ch="m0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="measure_m1", ch="m1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(
                            name="acquire",
                            duration=10,
                            t0=0,
                            qubits=[0, 1],
                            memory_slot=[0, 1],
                        ).to_dict(),
                    ],
                }).to_dict(),
            ],
        })

        mock_time = datetime.datetime.now()
        dt = 1.3333
        self._properties = BackendProperties(
            backend_name="fake_openpulse_2q",
            backend_version="0.0.0",
            last_update_date=mock_time,
            qubits=[
                [
                    Nduv(date=mock_time,
                         name="T1",
                         unit="µs",
                         value=71.9500421005539),
                    Nduv(date=mock_time,
                         name="T2",
                         unit="µs",
                         value=69.4240447362455),
                    Nduv(date=mock_time,
                         name="frequency",
                         unit="MHz",
                         value=4919.96800692),
                    Nduv(date=mock_time,
                         name="readout_error",
                         unit="",
                         value=0.02),
                ],
                [
                    Nduv(date=mock_time,
                         name="T1",
                         unit="µs",
                         value=81.9500421005539),
                    Nduv(date=mock_time,
                         name="T2",
                         unit="µs",
                         value=75.5598482446578),
                    Nduv(date=mock_time,
                         name="frequency",
                         unit="GHz",
                         value=5.01996800692),
                    Nduv(date=mock_time,
                         name="readout_error",
                         unit="",
                         value=0.02),
                ],
            ],
            gates=[
                Gate(
                    gate="u1",
                    qubits=[0],
                    parameters=[
                        Nduv(date=mock_time,
                             name="gate_error",
                             unit="",
                             value=0.06),
                        Nduv(date=mock_time,
                             name="gate_length",
                             unit="ns",
                             value=0.0),
                    ],
                ),
                Gate(
                    gate="u3",
                    qubits=[0],
                    parameters=[
                        Nduv(date=mock_time,
                             name="gate_error",
                             unit="",
                             value=0.06),
                        Nduv(date=mock_time,
                             name="gate_length",
                             unit="ns",
                             value=2 * dt),
                    ],
                ),
                Gate(
                    gate="u3",
                    qubits=[1],
                    parameters=[
                        Nduv(date=mock_time,
                             name="gate_error",
                             unit="",
                             value=0.06),
                        Nduv(date=mock_time,
                             name="gate_length",
                             unit="ns",
                             value=4 * dt),
                    ],
                ),
                Gate(
                    gate="cx",
                    qubits=[0, 1],
                    parameters=[
                        Nduv(date=mock_time,
                             name="gate_error",
                             unit="",
                             value=1.0),
                        Nduv(date=mock_time,
                             name="gate_length",
                             unit="ns",
                             value=22 * dt),
                    ],
                ),
            ],
            general=[],
        )

        super().__init__(configuration)
    def __init__(self):
        configuration = PulseBackendConfiguration(
            backend_name="fake_openpulse_3q",
            backend_version="0.0.0",
            n_qubits=3,
            meas_levels=[0, 1, 2],
            basis_gates=["u1", "u2", "u3", "cx", "id"],
            simulator=False,
            local=True,
            conditional=True,
            open_pulse=True,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
            coupling_map=[[0, 1], [1, 2]],
            n_registers=3,
            n_uchannels=3,
            u_channel_lo=[
                [UchannelLO(q=0, scale=1.0 + 0.0j)],
                [
                    UchannelLO(q=0, scale=-1.0 + 0.0j),
                    UchannelLO(q=1, scale=1.0 + 0.0j)
                ],
                [UchannelLO(q=0, scale=1.0 + 0.0j)],
            ],
            qubit_lo_range=[[4.5, 5.5], [4.5, 5.5], [4.5, 5.5]],
            meas_lo_range=[[6.0, 7.0], [6.0, 7.0], [6.0, 7.0]],
            dt=1.3333,
            dtm=10.5,
            rep_times=[100, 250, 500, 1000],
            meas_map=[[0, 1, 2]],
            channel_bandwidth=[
                [-0.2, 0.4],
                [-0.3, 0.3],
                [-0.3, 0.3],
                [-0.02, 0.02],
                [-0.02, 0.02],
                [-0.02, 0.02],
                [-0.2, 0.4],
                [-0.3, 0.3],
                [-0.3, 0.3],
            ],
            meas_kernels=["kernel1"],
            discriminators=["max_1Q_fidelity"],
            acquisition_latency=[[100, 100], [100, 100], [100, 100]],
            conditional_latency=[
                [100, 1000],
                [1000, 100],
                [100, 1000],
                [100, 1000],
                [1000, 100],
                [100, 1000],
                [1000, 100],
                [100, 1000],
                [1000, 100],
            ],
            channels={
                "acquire0": {
                    "type": "acquire",
                    "purpose": "acquire",
                    "operates": {
                        "qubits": [0]
                    }
                },
                "acquire1": {
                    "type": "acquire",
                    "purpose": "acquire",
                    "operates": {
                        "qubits": [1]
                    }
                },
                "acquire2": {
                    "type": "acquire",
                    "purpose": "acquire",
                    "operates": {
                        "qubits": [2]
                    }
                },
                "d0": {
                    "type": "drive",
                    "purpose": "drive",
                    "operates": {
                        "qubits": [0]
                    }
                },
                "d1": {
                    "type": "drive",
                    "purpose": "drive",
                    "operates": {
                        "qubits": [1]
                    }
                },
                "d2": {
                    "type": "drive",
                    "purpose": "drive",
                    "operates": {
                        "qubits": [2]
                    }
                },
                "m0": {
                    "type": "measure",
                    "purpose": "measure",
                    "operates": {
                        "qubits": [0]
                    }
                },
                "m1": {
                    "type": "measure",
                    "purpose": "measure",
                    "operates": {
                        "qubits": [1]
                    }
                },
                "m2": {
                    "type": "measure",
                    "purpose": "measure",
                    "operates": {
                        "qubits": [2]
                    }
                },
                "u0": {
                    "type": "control",
                    "purpose": "cross-resonance",
                    "operates": {
                        "qubits": [0, 1]
                    },
                },
                "u1": {
                    "type": "control",
                    "purpose": "cross-resonance",
                    "operates": {
                        "qubits": [1, 0]
                    },
                },
                "u2": {
                    "type": "control",
                    "purpose": "cross-resonance",
                    "operates": {
                        "qubits": [2, 1]
                    },
                },
            },
        )

        self._defaults = PulseDefaults.from_dict({
            "qubit_freq_est": [4.9, 5.0, 4.8],
            "meas_freq_est": [6.5, 6.6, 6.4],
            "buffer":
            10,
            "pulse_library": [
                {
                    "name": "x90p_d0",
                    "samples": 2 * [0.1 + 0j]
                },
                {
                    "name": "x90p_d1",
                    "samples": 2 * [0.1 + 0j]
                },
                {
                    "name": "x90p_d2",
                    "samples": 2 * [0.1 + 0j]
                },
                {
                    "name": "x90m_d0",
                    "samples": 2 * [-0.1 + 0j]
                },
                {
                    "name": "x90m_d1",
                    "samples": 2 * [-0.1 + 0j]
                },
                {
                    "name": "x90m_d2",
                    "samples": 2 * [-0.1 + 0j]
                },
                {
                    "name": "y90p_d0",
                    "samples": 2 * [0.1j]
                },
                {
                    "name": "y90p_d1",
                    "samples": 2 * [0.1j]
                },
                {
                    "name": "y90p_d2",
                    "samples": 2 * [0.1j]
                },
                {
                    "name": "xp_d0",
                    "samples": 2 * [0.2 + 0j]
                },
                {
                    "name": "ym_d0",
                    "samples": 2 * [-0.2j]
                },
                {
                    "name": "xp_d1",
                    "samples": 2 * [0.2 + 0j]
                },
                {
                    "name": "ym_d1",
                    "samples": 2 * [-0.2j]
                },
                {
                    "name": "cr90p_u0",
                    "samples": 9 * [0.1 + 0j]
                },
                {
                    "name": "cr90m_u0",
                    "samples": 9 * [-0.1 + 0j]
                },
                {
                    "name": "cr90p_u1",
                    "samples": 9 * [0.1 + 0j]
                },
                {
                    "name": "cr90m_u1",
                    "samples": 9 * [-0.1 + 0j]
                },
                {
                    "name": "measure_m0",
                    "samples": 10 * [0.1 + 0j]
                },
                {
                    "name": "measure_m1",
                    "samples": 10 * [0.1 + 0j]
                },
                {
                    "name": "measure_m2",
                    "samples": 10 * [0.1 + 0j]
                },
            ],
            "cmd_def": [
                Command.from_dict({
                    "name":
                    "u1",
                    "qubits": [0],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase="-P0").to_dict()
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u1",
                    "qubits": [1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=0,
                                             phase="-P0").to_dict()
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u1",
                    "qubits": [2],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d2",
                                             t0=0,
                                             phase="-P0").to_dict()
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u2",
                    "qubits": [0],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase="-P1").to_dict(),
                        PulseQobjInstruction(name="y90p_d0", ch="d0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=2,
                                             phase="-P0").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u2",
                    "qubits": [1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=0,
                                             phase="-P1").to_dict(),
                        PulseQobjInstruction(name="y90p_d1", ch="d1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=2,
                                             phase="-P0").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u2",
                    "qubits": [2],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d2",
                                             t0=0,
                                             phase="-P1").to_dict(),
                        PulseQobjInstruction(name="y90p_d2", ch="d2",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d2",
                                             t0=2,
                                             phase="-P0").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u3",
                    "qubits": [0],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase="-P2").to_dict(),
                        PulseQobjInstruction(name="x90p_d0", ch="d0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=2,
                                             phase="-P0").to_dict(),
                        PulseQobjInstruction(name="x90m_d0", ch="d0",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=4,
                                             phase="-P1").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u3",
                    "qubits": [1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=0,
                                             phase="-P2").to_dict(),
                        PulseQobjInstruction(name="x90p_d1", ch="d1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=2,
                                             phase="-P0").to_dict(),
                        PulseQobjInstruction(name="x90m_d1", ch="d1",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=4,
                                             phase="-P1").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "u3",
                    "qubits": [2],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d2",
                                             t0=0,
                                             phase="-P2").to_dict(),
                        PulseQobjInstruction(name="x90p_d2", ch="d2",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d2",
                                             t0=2,
                                             phase="-P0").to_dict(),
                        PulseQobjInstruction(name="x90m_d2", ch="d2",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="fc",
                                             ch="d2",
                                             t0=4,
                                             phase="-P1").to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "cx",
                    "qubits": [0, 1],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d0",
                                             t0=0,
                                             phase=1.57).to_dict(),
                        PulseQobjInstruction(name="ym_d0", ch="d0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="xp_d0", ch="d0",
                                             t0=11).to_dict(),
                        PulseQobjInstruction(name="x90p_d1", ch="d1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="cr90p_u0", ch="u0",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="cr90m_u0", ch="u0",
                                             t0=13).to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "cx",
                    "qubits": [1, 2],
                    "sequence": [
                        PulseQobjInstruction(name="fc",
                                             ch="d1",
                                             t0=0,
                                             phase=1.57).to_dict(),
                        PulseQobjInstruction(name="ym_d1", ch="d1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="xp_d1", ch="d1",
                                             t0=11).to_dict(),
                        PulseQobjInstruction(name="x90p_d2", ch="d2",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="cr90p_u1", ch="u1",
                                             t0=2).to_dict(),
                        PulseQobjInstruction(name="cr90m_u1", ch="u1",
                                             t0=13).to_dict(),
                    ],
                }).to_dict(),
                Command.from_dict({
                    "name":
                    "measure",
                    "qubits": [0, 1, 2],
                    "sequence": [
                        PulseQobjInstruction(name="measure_m0", ch="m0",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="measure_m1", ch="m1",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name="measure_m2", ch="m2",
                                             t0=0).to_dict(),
                        PulseQobjInstruction(
                            name="acquire",
                            duration=10,
                            t0=0,
                            qubits=[0, 1, 2],
                            memory_slot=[0, 1, 2],
                        ).to_dict(),
                    ],
                }).to_dict(),
            ],
        })
        super().__init__(configuration)
예제 #24
0
    def __init__(self):
        configuration = PulseBackendConfiguration(
            backend_name='fake_openpulse_2q',
            backend_version='0.0.0',
            n_qubits=2,
            meas_levels=[0, 1, 2],
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=True,
            open_pulse=True,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=[[1, 0]],
            n_registers=2,
            n_uchannels=2,
            u_channel_lo=[
                [UchannelLO(q=0, scale=1. + 0.j)],
                [UchannelLO(q=0, scale=-1. + 0.j), UchannelLO(q=1, scale=1. + 0.j)]
            ],
            meas_level=[1, 2],
            qubit_lo_range=[[4.5, 5.5], [4.5, 5.5]],
            meas_lo_range=[[6.0, 7.0], [6.0, 7.0]],
            dt=1.3333,
            dtm=10.5,
            rep_times=[100, 250, 500, 1000],
            meas_map=[[0, 1]],
            channel_bandwidth=[
                [-0.2, 0.4], [-0.3, 0.3], [-0.3, 0.3],
                [-0.02, 0.02], [-0.02, 0.02], [-0.02, 0.02]
            ],
            meas_kernels=['kernel1'],
            discriminators=['max_1Q_fidelity'],
            acquisition_latency=[[100, 100], [100, 100]],
            conditional_latency=[
                [100, 1000], [1000, 100], [100, 1000],
                [1000, 100], [100, 1000], [1000, 100]
            ]
        )

        self._defaults = PulseDefaults(
            qubit_freq_est=[4.9, 5.0],
            meas_freq_est=[6.5, 6.6],
            buffer=10,
            pulse_library=[PulseLibraryItem(name='test_pulse_1', samples=[0.j, 0.1j]),
                           PulseLibraryItem(name='test_pulse_2', samples=[0.j, 0.1j, 1j]),
                           PulseLibraryItem(name='test_pulse_3',
                                            samples=[0.j, 0.1j, 1j, 0.5 + 0j])],
            cmd_def=[Command(name='u1', qubits=[0],
                             sequence=[PulseQobjInstruction(name='fc', ch='d0',
                                                            t0=0, phase='-P1*np.pi')]),
                     Command(name='u3', qubits=[0],
                             sequence=[PulseQobjInstruction(name='test_pulse_1', ch='d0', t0=0)]),
                     Command(name='u3', qubits=[1],
                             sequence=[PulseQobjInstruction(name='test_pulse_3', ch='d1', t0=0)]),
                     Command(name='cx', qubits=[0, 1],
                             sequence=[PulseQobjInstruction(name='test_pulse_1', ch='d0', t0=0),
                                       PulseQobjInstruction(name='test_pulse_2', ch='u0', t0=10),
                                       PulseQobjInstruction(name='pv', ch='d1',
                                                            t0=2, val='cos(P2)'),
                                       PulseQobjInstruction(name='test_pulse_1', ch='d1', t0=20),
                                       PulseQobjInstruction(name='fc', ch='d1',
                                                            t0=20, phase=2.1)]),
                     Command(name='measure', qubits=[0],
                             sequence=[PulseQobjInstruction(name='test_pulse_1', ch='m0', t0=0),
                                       PulseQobjInstruction(name='acquire', duration=10, t0=0,
                                                            qubits=[0], memory_slot=[0])])]
        )

        super().__init__(configuration)
예제 #25
0
    def __init__(self):
        configuration = PulseBackendConfiguration(
            backend_name='fake_openpulse_3q',
            backend_version='0.0.0',
            n_qubits=3,
            meas_levels=[0, 1, 2],
            basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
            simulator=False,
            local=True,
            conditional=True,
            open_pulse=True,
            memory=False,
            max_shots=65536,
            gates=[GateConfig(name='TODO', parameters=[], qasm_def='TODO')],
            coupling_map=[[0, 1], [1, 2]],
            n_registers=3,
            n_uchannels=3,
            u_channel_lo=[
                [UchannelLO(q=0, scale=1. + 0.j)],
                [UchannelLO(q=0, scale=-1. + 0.j), UchannelLO(q=1, scale=1. + 0.j)],
                [UchannelLO(q=0, scale=1. + 0.j)]
            ],
            qubit_lo_range=[[4.5, 5.5], [4.5, 5.5], [4.5, 5.5]],
            meas_lo_range=[[6.0, 7.0], [6.0, 7.0], [6.0, 7.0]],
            dt=1.3333,
            dtm=10.5,
            rep_times=[100, 250, 500, 1000],
            meas_map=[[0, 1, 2]],
            channel_bandwidth=[
                [-0.2, 0.4], [-0.3, 0.3], [-0.3, 0.3],
                [-0.02, 0.02], [-0.02, 0.02], [-0.02, 0.02],
                [-0.2, 0.4], [-0.3, 0.3], [-0.3, 0.3]
            ],
            meas_kernels=['kernel1'],
            discriminators=['max_1Q_fidelity'],
            acquisition_latency=[[100, 100], [100, 100], [100, 100]],
            conditional_latency=[
                [100, 1000], [1000, 100], [100, 1000],
                [100, 1000], [1000, 100], [100, 1000],
                [1000, 100], [100, 1000], [1000, 100]
            ],
            channels={
                'acquire0': {
                    'type': 'acquire',
                    'purpose': 'acquire',
                    'operates': {'qubits': [0]}
                },
                'acquire1': {
                    'type': 'acquire',
                    'purpose': 'acquire',
                    'operates': {'qubits': [1]}
                },
                'acquire2': {
                    'type': 'acquire',
                    'purpose': 'acquire',
                    'operates': {'qubits': [2]}
                },
                'd0': {
                    'type': 'drive',
                    'purpose': 'drive',
                    'operates': {'qubits': [0]}
                },
                'd1': {
                    'type': 'drive',
                    'purpose': 'drive',
                    'operates': {'qubits': [1]}
                },
                'd2': {
                    'type': 'drive',
                    'purpose': 'drive',
                    'operates': {'qubits': [2]}
                },
                'm0': {
                    'type': 'measure',
                    'purpose': 'measure',
                    'operates': {'qubits': [0]}
                },
                'm1': {
                    'type': 'measure',
                    'purpose': 'measure',
                    'operates': {'qubits': [1]}
                },
                'm2': {
                    'type': 'measure',
                    'purpose': 'measure',
                    'operates': {'qubits': [2]}
                },
                'u0': {
                    'type': 'control',
                    'purpose': 'cross-resonance',
                    'operates': {'qubits': [0, 1]}
                },
                'u1': {
                    'type': 'control',
                    'purpose': 'cross-resonance',
                    'operates': {'qubits': [1, 0]}
                },
                'u2': {
                    'type': 'control',
                    'purpose': 'cross-resonance',
                    'operates': {'qubits': [2, 1]}
                }
            }
        )

        self._defaults = PulseDefaults.from_dict({
            'qubit_freq_est': [4.9, 5.0, 4.8],
            'meas_freq_est': [6.5, 6.6, 6.4],
            'buffer': 10,
            'pulse_library': [
                {
                    'name': 'test_pulse_1',
                    'samples': [[0.0, 0.0], [0.0, 0.1]]
                },
                {
                    'name': 'test_pulse_2',
                    'samples': [[0.0, 0.0], [0.0, 0.1], [0.0, 1.0]]
                },
                {
                    'name': 'test_pulse_3',
                    'samples': [[0.0, 0.0], [0.0, 0.1], [0.0, 1.0], [0.5, 0.0]]
                },
                {
                    'name': 'test_pulse_4',
                    'samples': 7 * [
                        [0.0, 0.0], [0.0, 0.1], [0.0, 1.0], [0.5, 0.0]
                    ]
                }
            ],

            'cmd_def': [
                Command.from_dict({
                    'name': 'u1',
                    'qubits': [0],
                    'sequence': [
                        PulseQobjInstruction(name='fc',
                                             ch='d0',
                                             t0=0,
                                             phase='-P0').to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'u1',
                    'qubits': [1],
                    'sequence': [
                        PulseQobjInstruction(name='fc',
                                             ch='d1',
                                             t0=0,
                                             phase='-P0').to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'u1',
                    'qubits': [2],
                    'sequence': [
                        PulseQobjInstruction(name='fc',
                                             ch='d2',
                                             t0=0,
                                             phase='-P0').to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'u2',
                    'qubits': [0],
                    'sequence': [
                        PulseQobjInstruction(name='fc',
                                             ch='d0',
                                             t0=0,
                                             phase='-P1').to_dict(),
                        PulseQobjInstruction(name='test_pulse_4',
                                             ch='d0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='fc',
                                             ch='d0',
                                             t0=0,
                                             phase='-P0').to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'u2',
                    'qubits': [1],
                    'sequence': [
                        PulseQobjInstruction(name='fc',
                                             ch='d1',
                                             t0=0,
                                             phase='-P1').to_dict(),
                        PulseQobjInstruction(name='test_pulse_4',
                                             ch='d1',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='fc',
                                             ch='d1',
                                             t0=0,
                                             phase='-P0').to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'u2',
                    'qubits': [2],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_3',
                                             ch='d2',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='fc',
                                             ch='d2',
                                             t0=0,
                                             phase='-P0').to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'u3',
                    'qubits': [0],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='d0',
                                             t0=0).to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'u3',
                    'qubits': [1],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_3',
                                             ch='d1',
                                             t0=0).to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'cx',
                    'qubits': [0, 1],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='d0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_2',
                                             ch='u0',
                                             t0=10).to_dict(),
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='d1',
                                             t0=20).to_dict(),
                        PulseQobjInstruction(name='fc',
                                             ch='d1',
                                             t0=20,
                                             phase=2.1).to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'cx',
                    'qubits': [1, 2],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='d1',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_2',
                                             ch='u1',
                                             t0=10).to_dict(),
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='d2',
                                             t0=20).to_dict(),
                        PulseQobjInstruction(name='fc',
                                             ch='d2',
                                             t0=20,
                                             phase=2.1).to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'ParametrizedGate',
                    'qubits': [0, 1],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='d0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_2',
                                             ch='u0',
                                             t0=10).to_dict(),
                        PulseQobjInstruction(name='pv',
                                             ch='d1',
                                             t0=2,
                                             val='cos(P2)').to_dict(),
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='d1',
                                             t0=20).to_dict(),
                        PulseQobjInstruction(name='fc',
                                             ch='d1',
                                             t0=20,
                                             phase=2.1).to_dict()]}).to_dict(),
                Command.from_dict({
                    'name': 'measure',
                    'qubits': [0, 1, 2],
                    'sequence': [
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='m0',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='m1',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='test_pulse_1',
                                             ch='m2',
                                             t0=0).to_dict(),
                        PulseQobjInstruction(name='acquire',
                                             duration=10,
                                             t0=0,
                                             qubits=[0, 1, 2],
                                             memory_slot=[0, 1, 2]).to_dict()]
                }).to_dict()
            ]
        })
        super().__init__(configuration)
    def __init__(self):
        """

        .. code-block:: text

            00 ↔ 01 ↔ 02 ↔ 03 ↔ 04
             ↕                   ↕
            05 ↔ 06 ↔ 07 ↔ 08 ↔ 09
             ↕         ↕         ↕
            10 ↔ 11 ↔ 12 ↔ 13 ↔ 14
             ↕                   ↕
            15 ↔ 16 ↔ 17 ↔ 18 ↔ 19
        """
        cmap = [
            [0, 1],
            [0, 5],
            [1, 0],
            [1, 2],
            [2, 1],
            [2, 3],
            [3, 2],
            [3, 4],
            [4, 3],
            [4, 9],
            [5, 0],
            [5, 6],
            [5, 10],
            [6, 5],
            [6, 7],
            [7, 6],
            [7, 8],
            [7, 12],
            [8, 7],
            [8, 9],
            [9, 4],
            [9, 8],
            [9, 14],
            [10, 5],
            [10, 11],
            [10, 15],
            [11, 10],
            [11, 12],
            [12, 7],
            [12, 11],
            [12, 13],
            [13, 12],
            [13, 14],
            [14, 9],
            [14, 13],
            [14, 19],
            [15, 10],
            [15, 16],
            [16, 15],
            [16, 17],
            [17, 16],
            [17, 18],
            [18, 17],
            [18, 19],
            [19, 14],
            [19, 18],
        ]

        configuration = QasmBackendConfiguration(
            backend_name="fake_poughkeepsie",
            backend_version="0.0.0",
            n_qubits=20,
            basis_gates=["u1", "u2", "u3", "cx", "id"],
            simulator=False,
            local=True,
            conditional=False,
            open_pulse=False,
            memory=True,
            max_shots=8192,
            max_experiments=900,
            gates=[GateConfig(name="TODO", parameters=[], qasm_def="TODO")],
            coupling_map=cmap,
        )

        super().__init__(configuration)