Skip to content

Composing incompatible circuits raises obscure message about "more 'in' edges" #13935

@1ucian0

Description

@1ucian0

When composing incompatible circuits like in these situations, the raising message is a bit obscure.

qc = QuantumCircuit(1)
qc.compose(QuantumCircuit(2))
qc = QuantumCircuit(1, 1)
qc.compose(QuantumCircuit(1, 2))
qiskit.circuit.exceptions.CircuitError: "Trying to compose with another QuantumCircuit which has more 'in' edges."

Specially for new users (that have greatest chance to see this message), I feel it is unnecessarily complicated to introduce the notion of 'in' edges. It could say something like a "a circuit with 2 qubit/s cannot be composed into a circuit with 1 qubit/s" or "a circuit with 2 classical bit/s cannot be composed into a circuit with 1 classical bit/s"

Metadata

Metadata

Assignees

Labels

Projects

  • Status

    Tagged but unassigned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions