question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoiseAdaptiveLayout raises for FakePoughkeepsie with calibration data

See original GitHub issue

From https://travis-ci.com/Qiskit/qiskit-terra/jobs/237611866#L11958

>>> import qiskit as qk
>>> from qiskit.test.mock import FakePoughkeepsie
>>> qc = qk.QuantumCircuit.from_qasm_str('''
OPENQASM 2.0;
include "qelib1.inc";
qreg q7159[6];
qreg q7160[2];
creg c1212[1];
cx q7159[5],q7159[4];
cx q7159[3],q7159[2];
cx q7159[1],q7159[0];
cx q7160[1],q7160[0];
measure q7160[1] -> c1212[0];''')
>>> qk.transpile(qc, backend=FakePoughkeepsie(), optimization_level=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/compiler/transpile.py", line 200, in transpile
    circuits = parallel_map(_transpile_circuit, list(zip(circuits, transpile_configs)))
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/tools/parallel.py", line 100, in parallel_map
    return [task(values[0], *task_args, **task_kwargs)]
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/compiler/transpile.py", line 221, in _transpile_circuit
    return transpile_circuit(circuit, transpile_config)
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/transpiler/transpile_circuit.py", line 62, in transpile_circuit
    out_circuit = pass_manager.run(circuit)
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/transpiler/passmanager.py", line 172, in run
    dag = self._do_pass(pass_, dag, passset.options)
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/transpiler/passmanager.py", line 223, in _do_pass
    dag = self._run_this_pass(pass_, dag)
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/transpiler/passmanager.py", line 255, in _run_this_pass
    pass_.run(FencedDAGCircuit(dag))
  File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/transpiler/passes/mapping/noise_adaptive_layout.py", line 229, in run
    self.prog2hw[edge[0]] = best_hw_edge[0]
TypeError: 'NoneType' object is not subscriptable

Calibration data was recently added to the FakePoughkeepsie mock backend in #3060.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ajavadiacommented, Sep 27, 2019

This sounds like a good approach.

And yes the properties look wrong. I think there was a problem with the device when these were generated. I can regenerate this for Poughkeepsie.

On Sep 27, 2019, at 7:05 AM, brandhsn notifications@github.com wrote:

I had a quick look into this. It seems the algorithm of the NoiseAdaptiveLayout run is mostly correct.

At the step the algorithm fails in the above trace, the algorithm tries to find the optimal placement of a CNOT gate in the quantum hardware. The algorithm fails because it cannot find any such placement, since at this point all remaining hardware cx links are either occupied or have an error rate of 1.0. The algorithm regards a hardware cx link with an error rate of 1.0 as being completely broken and does not try to fit a CNOT gate into such a hardware link.

I suggest doing the following:

Right now, the backend properties file of fake poughkeepsie sets the error rate of 34 of the available 46 hardware cx gates to 1.0. The backend properties file at https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/test/mock/props_poughkeepsie.json should be modified such that the value of the gate_error parameter of hardware cx links is lower than 1.0, unless the hardware cx link should not be used at all. The method run(self, dag) should raise an error if there is no available hardware cx gate or qubit left and the circuit has not been placed completely. (3.0 Allow the algorithm to choose a hardware cx link with an error rate of 1.0, if there is no other option?) Field variable names such as cx_errors, readout_errors, gate_cost should be changed to reflect that they actually represent the reliability of cx/readout/gates as this is very confusing. I can do 2.-3. but I do not know how to generate the JSON file that define the properties of a backend.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

0reactions
ajavadiacommented, Oct 8, 2019

Ok i updated Poughkeepsie’s properties in #3226

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transpiler - GitHub
Fix calibration handling of transpiler passes on gates with >2 qubits #6655 ... NoiseAdaptiveLayout raises for FakePoughkeepsie with calibration data #3124 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found