-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot convert Results from QLM emulator to Pulser Samples #1
Comments
Hi Harold, Thanks for your detailed issue. We purposely chose not to modify the meta_data of myQLM Results obtained using a MyQLM Emulator for it to contain the minimal information to turn it into a Pulser Result, because the meta_data contained in this object depends on the emulator and we don't want to overwrite information, and because it has never been made clear what are the keys each emulator provides in their mata_data. Concretely, the fact that However, it does not seem unfeasible to have a sample_myqlm_results method if that's of use ? |
Hi Antoine, Thanks for your comments. These are indeed the conclusions I had reached. I don't know how important it would be to have this feature: my motivation was to have a pipeline as close as possible with the QLM and the future Pasqal machine at TGCC. My understanding is that the latter would yield myQLM results which can be converted to Pulser samples. However, for testing purpose, I can as well do: samples = {
str(sample.state): int(sample.probability * len(results))
for sample in results
} And for computations of observables, one can work directly with the probabilities.
I was discussing with people at Eviden, and they told me that users can ask to get shots, but by default data is aggregated, which yields probabilities: > job = IsingAQPU.convert_sequence_to_job(sequence, nbshots=0)
> job.aggregate_data
True Maybe there is a way to ask myQLM to return non-aggregated data? In this case, you don't have to modify Edit: it seems AnalogQPU cannot return samples indeed, the choice of aggregating or not seems to be only for digital emulators. |
For your testing, I suggest you use the multinomial distribution to sample the probability distribution obtained and stored in the myQLM Result object. This is what we do in Pulser https://github.com/pasqal-io/Pulser/blob/develop/pulser-core/pulser/result.py#L73. However, it seems to me there is enough material in the MyQLM Result class to have a function "get_pulser_result_from_myqlm_result", that would return you a Pulser Result from a MyQLM one. With the Pulser Result class, you will be able to use the method "get_samples" to get the samples (see above). |
Thanks for the additional comments. I will have a look at all this later and may propose a PR if this seems useful. |
The interface seems to be inconsistent between the qutip and QLM emulators. I am running some code on the QLM40 machine at TGCC, and also locally with qutip, but I get an error when trying to convert myqlm results to pulser samples.
Here is the overall job submission:
The last line returns an error:
because
results.meta_data
isThe results have lost tracks of the number of qubits.
On the other hand, setting
yields results with
results.meta_data
such thatI am not sure why
n_qubits
is not stored inmeta_data
since it's clearly available in the sequence. On the other hand, I understand that havingnbshots = 0
(as required when running on the QLM40) is problematic.I think that it would have been nice if
IsingAQPU.convert_result_to_samples
was made to work also for QLM emulation.The text was updated successfully, but these errors were encountered: