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

Fix the leaking noise objects #89

Merged
merged 2 commits into from
Aug 3, 2021
Merged

Fix the leaking noise objects #89

merged 2 commits into from
Aug 3, 2021

Conversation

BoxiLi
Copy link
Member

@BoxiLi BoxiLi commented Aug 1, 2021

A list of noise objects defined by the user is passed to the function. However, when adding T1 and T2 noise, the generated objects were added directly to the list. This changes the noise_list defined by the user and is a problem if the same Processor instance is used to perform more than one simulation. The T1,T2 noise objects from the previous run will accumulate in the noise_list. Therefore, we copy the list before add T1 T2 noise.

A list of noise objects defined by the user is passed to the function. However, when adding T1 and T2 noise, the generated objects were added directly to the list. This changes the `noise_list` defined by the user and is a problem if the same `Processor` instance is used to perform more than one simulation. The T1,T2 noise objects from the previous run will accumulate in the `noise_list`. Therefore, we copy the list before add T1 T2 noise.
@BoxiLi BoxiLi added this to the qutip-qip-0.1.2 milestone Aug 1, 2021
Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@BoxiLi BoxiLi merged commit 88cc63c into qutip:master Aug 3, 2021
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Nov 13, 2021
A list of noise objects defined by the user is passed to the function. However, when adding T1 and T2 noise, the generated objects were added directly to the list. This changes the `noise_list` defined by the user and is a problem if the same `Processor` instance is used to perform more than one simulation. The T1,T2 noise objects from the previous run will accumulate in the `noise_list`. Therefore, we copy the list before add T1 T2 noise.
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Nov 24, 2021
A list of noise objects defined by the user is passed to the function. However, when adding T1 and T2 noise, the generated objects were added directly to the list. This changes the `noise_list` defined by the user and is a problem if the same `Processor` instance is used to perform more than one simulation. The T1,T2 noise objects from the previous run will accumulate in the `noise_list`. Therefore, we copy the list before add T1 T2 noise.
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.

None yet

2 participants