catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Explicitly clarify that `AllocateQubits(N)` returns a vector from 0 to N in documentation

Open paul0403 opened this issue 8 months ago • 1 comments

In the documentation for adding a custom device, it should be specified that the AllocateQubits method of a custom device should return a vector from 0 to num_qubits. Right now the documentation makes it seem like it can just return a vector initialized with all zeros (or whatever that particular machine's cpp default initializes vectors to).

This can lead to confusion for external device implementors following the guide. For example, if the vector is initialized with all zeros, this would lead to the implementor finding __catalyst__rt__array_get_element_ptr_1d always returning zero regardless of the target wire.

paul0403 avatar Feb 11 '25 14:02 paul0403