Isometry decomposition does not maintain gate width
See original GitHub issueThe definition
of an Isometry
instruction does not always have the same number of qubits as the original instruction. e.g.
>>> qc = qk.QuantumCircuit(2)
>>> qc.iso(np.eye(4), [0, 1], [])
<qiskit.circuit.instructionset.InstructionSet object at 0x10b4bfe80>
>>> print(qc)
ββββββββ
q_0: |0>β€0 β
β iso β
q_1: |0>β€1 β
ββββββββ
>>> print(qc.decompose())
ββββββ
q_0: |0>β€ Id β
ββββββ
q_1: |0>ββββββ
This also occurs for a handful of the examples from https://github.com/Qiskit/qiskit-terra/blob/576b984/test/python/circuit/test_isometry.py#L36 . This confuses e.g. DAGCircuit.substitute_node
which expects node replacements to keep the same shape.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Quantum Circuits for Sparse Isometries - arXiv
The main idea behind the decomposition there is to use pivoting gates, which permute the entries of the state such that the non-zero...
Read more >Quantum circuits for isometries - White Rose Research Online
lower bound on the number of C-not gates required to decompose an arbitrary isometry from m to n qubits, and give three explicit...
Read more >Machine Learning For Decomposing Arbitrary Unitary ...
There is something called Isometries [2] where we can decompose any unitary circuit using CNOTs and single-qubit gates.
Read more >Quasiprobability decompositions with reduced sampling ...
However, this decomposition set does not necessarily produce the optimal ... This corresponds to simulating an ideal quantum gate U usingΒ ...
Read more >Quantum Circuits for Isometries
Every quantum gate can be decomposed into a sequence of ... number of C-not gates required to decompose an isometry for arbitrary m...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Iβm not quite convinced this is really a bug, is it? I would imagine that if you have a gate defined on a set of qubit but it doesnβt actually do anything then shouldnβt it decompose to no operation at all? π
I donβt think this is an issue anymore (though Iβm not exactly sure whatβs changed to resolve it). If I try to reproduce the original issue:
it looks like
Isometry
no longer generatesId
s on some of the qubits (which was weird, but not necessarily a bug). If I try to reproduce the originalsubstitute_node_with_dag
issue:things behave as expected, so I think this can be closed.