hybridq icon indicating copy to clipboard operation
hybridq copied to clipboard

Pad qubits if `simplify` reduces number of qubits while using `circuit.simulation.simulate`

Open s-mandra opened this issue 3 years ago • 0 comments

When simulation.simulate(circuit=circuit, simplify=True, remove_id_gates=False), if the number of qubits changes (that is, some qubits in circuit are removed after the simplification), HybridQ returns an error. At the moment, simulation.simulate(circuit=circuit, simplify=True, remove_id_gates=True) solves the problem, but it add an avoidable overhead.

The simplest solution would be to pad the missing qubits at the end of the simulation rather than at the beginning.

s-mandra avatar Nov 16 '21 16:11 s-mandra