hybridq
hybridq copied to clipboard
Pad qubits if `simplify` reduces number of qubits while using `circuit.simulation.simulate`
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.