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

Ensure dtype in Qobj creation functions. #2321

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

Ericgig
Copy link
Member

@Ericgig Ericgig commented Feb 8, 2024

Description
In #2314, it was found that Qobj creation functions could return an unexpected dtype for incomplete data layers.
For example if mul specialization is missing scale * basis(..., dtype) would not return a Qobj using dtype.
I reviewed functions in states.py, operators.py and random_object.py.

@coveralls
Copy link

Coverage Status

coverage: 85.808% (+0.007%) from 85.801%
when pulling 1316bd6 on Ericgig:misc.create_to_fix
into fcb4117 on qutip:master.

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.

We should also document the default dtypes, but this looks like a good improvement.

@Ericgig Ericgig merged commit c31ed70 into qutip:master Feb 13, 2024
10 of 12 checks passed
@Ericgig Ericgig deleted the misc.create_to_fix branch February 13, 2024 13:41
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

3 participants