Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for backends with defective qubits and gates #4110

Merged
merged 73 commits into from
Jul 13, 2020

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Apr 8, 2020

Like #4083 but assuming the functional coupling map is connected. This approach is simpler, so the only pending here deceside a coupling map when is disconnected. (feature added in 232e1b8)

Example:
Consider the following coupling map, were Q1 is non-operational:

         0 ↔ (1) ↔ 3 ↔ 4
              ↕
              2

The functional coupling map in this situation is only 3 ↔ 4.

circuit = QuantumCircuit(QuantumRegister(2, 'qr'))
circuit.h(range(2))
circuit.cz(0, 1)
circuit.measure_all()
result = transpile(circuit, backend=FakeOurenseFaultyQ1())
print(result)
disconnected_0 -> 0 ──────────────────────────────────────

      faulty_0 -> 1 ──────────────────────────────────────

disconnected_1 -> 2 ──────────────────────────────────────
                    ┌──────────┐                  ░ ┌─┐
          qr_0 -> 3 ┤ U2(0,pi) ├──■───────────────░─┤M├───
                    └──────────┘┌─┴─┐┌──────────┐ ░ └╥┘┌─┐
          qr_1 -> 4 ────────────┤ X ├┤ U2(0,pi) ├─░──╫─┤M├
                                └───┘└──────────┘ ░  ║ └╥┘
            meas_0: ═════════════════════════════════╩══╬═
                                                        ║
            meas_1: ════════════════════════════════════╩═

Copy link
Member

@ajavadia ajavadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good except location of two methods

@@ -62,6 +62,30 @@ def configuration(self):
"""
return self._configuration

def faulty_qubits(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be a method of base backend. it should be in qiskit/providers/models/backendproperties.py

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved in db52ca4

faulty.append(qubit)
return faulty

def faulty_gates(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved in db52ca4

@mergify mergify bot merged commit 41cf87c into Qiskit:master Jul 13, 2020
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Jul 16, 2020
…4110)"

This commit reverts Qiskit#4110 which has introduced several issues with
transpilation in parallel. It's causing hangs for characterization
circuit transpilation in ignis which is breaking ignis CI. It also
straight up breaks parallel transpilation with the ibmq provider,
see Qiskit/qiskit-ibmq-provider#712. The fundamental cause seems to be
that Qiskit#4110 added new arguments to the parallel_map call inside transpile
which uses types which are not guaranteed to pickleable or hang while
trying to pickle them. This breaks transpile >1 input circuit with these
backends. This wasn't caught in tests because we don't directly test
these backends because they're outside of terra.

This reverts commit 41cf87c.
kdk pushed a commit that referenced this pull request Jul 16, 2020
…#4723)

This commit reverts #4110 which has introduced several issues with
transpilation in parallel. It's causing hangs for characterization
circuit transpilation in ignis which is breaking ignis CI. It also
straight up breaks parallel transpilation with the ibmq provider,
see Qiskit/qiskit-ibmq-provider#712. The fundamental cause seems to be
that #4110 added new arguments to the parallel_map call inside transpile
which uses types which are not guaranteed to pickleable or hang while
trying to pickle them. This breaks transpile >1 input circuit with these
backends. This wasn't caught in tests because we don't directly test
these backends because they're outside of terra.

This reverts commit 41cf87c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants