Ejemplo n.º 1
0
def test_NxDevice(isa_dict, noise_model_dict):
    graph = isa_to_graph(ISA.from_dict(isa_dict))
    nxdev = NxDevice(graph)

    device_raw = {'isa': isa_dict,
                  'noise_model': noise_model_dict,
                  'is_online': True,
                  'is_retuning': False}
    dev = Device(DEVICE_FIXTURE_NAME, device_raw)

    nx.is_isomorphic(nxdev.qubit_topology(), dev.qubit_topology())
    isa = nxdev.get_isa()
    assert isa.qubits[0].type == 'Xhalves'
Ejemplo n.º 2
0
def test_NxDevice(isa_dict, noise_model_dict):
    graph = isa_to_graph(ISA.from_dict(isa_dict))
    nxdev = NxDevice(graph)

    device_raw = {
        "isa": isa_dict,
        "noise_model": noise_model_dict,
        "is_online": True,
        "is_retuning": False,
    }
    dev = Device(DEVICE_FIXTURE_NAME, device_raw)

    nx.is_isomorphic(nxdev.qubit_topology(), dev.qubit_topology())
    isa = nxdev.get_isa()
    assert isa.qubits[0].type == "Xhalves"
Ejemplo n.º 3
0
def test_isa_to_graph(isa_dict):
    graph = isa_to_graph(ISA.from_dict(isa_dict))
    should_be = nx.from_edgelist([(0, 1), (1, 2), (0, 2)])
    assert nx.is_isomorphic(graph, should_be)