Skip to content
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

Add a default max_step to the processors #183

Merged
merged 8 commits into from
Dec 11, 2022
Merged

Conversation

BoxiLi
Copy link
Member

@BoxiLi BoxiLi commented Dec 9, 2022

Similar to qutip/qutip#2040, with a separate handling of options for qutip-v5.

@BoxiLi BoxiLi added this to the qutip-qip-0.2.3 milestone Dec 9, 2022
@BoxiLi BoxiLi marked this pull request as draft December 9, 2022 22:20
@BoxiLi BoxiLi marked this pull request as ready for review December 9, 2022 22:49
@BoxiLi
Copy link
Member Author

BoxiLi commented Dec 9, 2022

Although this does solve the skipping pulse issue. On my computer, it increases the total time for the tests from 40 seconds to 3 min...

@BoxiLi
Copy link
Member Author

BoxiLi commented Dec 9, 2022

The main slow down is actually at the computation of the full tlist, not the time evolution.

@BoxiLi BoxiLi marked this pull request as draft December 9, 2022 23:35
@hodgestar
Copy link
Contributor

That is quite a big slowdown. Can we make get_full_tlist more efficient? Or avoid calculating the full tlist and just get the smallest difference?

@BoxiLi
Copy link
Member Author

BoxiLi commented Dec 10, 2022

Having a closer look again, the main problem is actually with the CircuitQED, where a much smaller sampling step is needed for coeff to represent a continuous pulse shape. What we get from get_full_tlist is only the smallest sampling step size in tlist, rather than the gate time. The gate time information is not kept, unfortunately. What you suggest in the other repo in qutip, saving the max_step in QobjEvo would be helpful.

This problem does not exist in qutip.qip inside qutip--v4, because there is no CircuitQED model.

@BoxiLi
Copy link
Member Author

BoxiLi commented Dec 10, 2022

An alternative is to use something like one-tenth of the total circuit pulse time. This does not solve the problem completely. But it will avoid those mistakes that keep popping up when people try and compile one gate and send it to the solver. When there are more gates and a non-trivial circuit, the probability of this happening will be very low.

@hodgestar
Copy link
Contributor

I'm okay with a hackier solution like 0.1 * total_time for now, and a comment explaining the problem and perhaps referencing a GitHub issue that explains the difficulties.

This does not solve the problem completely. But it will avoid those mistakes that keep popping up when people try and compile one gate and send it to the solver. When there are more gates and a non-trivial circuit, the probability of this happening will be very low.
@BoxiLi BoxiLi marked this pull request as ready for review December 10, 2022 23:01
@BoxiLi BoxiLi merged commit 1d885dc into qutip:master Dec 11, 2022
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Dec 11, 2022
Add a default max_step based on the total circuit time.

This does not solve the problem completely. But it will avoid those mistakes that keep popping up when people try and compile one gate and send it to the solver. When there are more gates and a non-trivial circuit, the probability of this happening will be very low.
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Dec 11, 2022
Add a default max_step based on the total circuit time.

This does not solve the problem completely. But it will avoid those mistakes that keep popping up when people try and compile one gate and send it to the solver. When there are more gates and a non-trivial circuit, the probability of this happening will be very low.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants