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

Final time calculation in _concatenate_pulses. #162

Merged
merged 4 commits into from
Sep 6, 2022

Conversation

christian512
Copy link
Contributor

The calculation of final_time was done by taking the last element of the tlist in compiled_tlist. However, the elements in compiled_tlist are again lists, where the first element is just a list and the second element are the actual times.
E.g. tlist = [[0.0], np.array([...])]

So we have to take the second ( i.e. last) element from that and then the last element to get the largest time.
The previous version sometimes produced errors when using processor.load_circuit(...).

@christian512
Copy link
Contributor Author

The CI fails due to the error that is fixed in this PR: #163

@hodgestar
Copy link
Contributor

@christian512 Do you have a test we can add for this?

@BoxiLi
Copy link
Member

BoxiLi commented Aug 31, 2022

This is very strange... I think they should be either all lists or all arrays. Let me have a closer look at it.

@BoxiLi
Copy link
Member

BoxiLi commented Aug 31, 2022

Yes, you are right. It wasn't showing up because in most of the examples all the sub tlists have the same size and NumPy treat them as a 2D array.
Let me try to construct a test for this.

@christian512 do you mind if I push to this branch?

@hodgestar
Copy link
Contributor

@christian512 do you mind if I push to this branch?

@BoxiLi Christian is on holiday this week, so I think he is fine with you pushing to this branch at the moment.

christian512 and others added 3 commits September 4, 2022 19:48
Test against compilation routines, where different sampling numbers are used in different gates.
@BoxiLi BoxiLi merged commit e12440d into qutip:master Sep 6, 2022
@BoxiLi BoxiLi added this to the qutip-qip-0.2.3 milestone Sep 11, 2022
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Oct 23, 2022
Fix the final time calculation in `_concatenate_pulses`.
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.

3 participants