Closed speller26 closed 1 week ago
PR https://github.com/amazon-braket/amazon-braket-default-simulator-python/pull/237 contains a possible approach to implementing this in the local simulator.
Just a note @AbdullahKazi500 - issues for unitaryHACK should only be assigned after the corresponding PR is accepted and merged. Feel free to continue to work on the PR in the meantime!
hi @rmshaffer And @speller26 is it okay to modify the simulator function while getting the results
as in LocalSimulator().run(circuit, shots=1000)
this line
@speller26 made a PR to fix I am assuming that there might be something about instantiate or initialising the local simulator which has something to do with backend but lets see how it goes added the tests as well
The idea of this issue is to modify the simulator (namely, the BaseLocalSimulator) to support non-contiguous qubits. Adding that support will automatically enable the LocalSimulator to run such circuits (rather than modifying the initializer of the LocalSimulator class).
I would like to submit my PR.
@WingCode Good work all the best
Describe the feature you'd like The local simulator should support programs which use non-contiguous qubit indices, including cases where the qubit indices do not start from qubit 0.
Right now, the local simulator requires all qubits to be contiguous; in other words, an $n$-qubit circuit must use exactly the qubits $0, 1, \ldots n - 1$, without omitting any or including any additional qubits:
This constraint is unnecessary, and it would be worth modifying the default simulator implementation to allow arbitrary qubit indices, as in the above example.
How would this feature be used? Please describe. This would allow users to test circuits on the local simulator before running them, unmodified, on a QPU. For example, without this feature, a circuit meant to run on a QPU with indices $2, 4, 7$ would first need to be modified to use qubits $0, 1, 2$ before it can be tested locally. This feature would also help prevent bugs that arise from translating qubit indices.
Describe alternatives you've considered Qubits could be mapped manually, but this is unnecessarily complicated.