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

Resolve type instabilities while generating Qobj (2nd try) #179

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

ytdHuang
Copy link
Member

@ytdHuang ytdHuang commented Jun 27, 2024

This is the second try for PR #178, and also fixes #177.

Summary of this PR:

  • Add type instability tests
  • Gather some of the Error tests together in QuantumObject testset

When the input array is a matrix, and the user didn't specify type. We test this kind of cases with the following code:

T = ComplexF64
UnionType = Union{QuantumObject{Matrix{T},BraQuantumObject},QuantumObject{Matrix{T},OperatorQuantumObject}}
a = rand(T, 1, 10)
@inferred UnionType Qobj(a)

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.37%. Comparing base (4f94f9b) to head (be9da54).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #179      +/-   ##
==========================================
+ Coverage   93.35%   93.37%   +0.01%     
==========================================
  Files          28       28              
  Lines        2093     2098       +5     
==========================================
+ Hits         1954     1959       +5     
  Misses        139      139              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/qobj/quantum_object.jl Outdated Show resolved Hide resolved
src/qobj/quantum_object.jl Outdated Show resolved Hide resolved
test/quantum_objects.jl Outdated Show resolved Hide resolved
@albertomercurio albertomercurio merged commit 092372a into qutip:main Jun 27, 2024
14 checks passed
@ytdHuang ytdHuang deleted the opt/gen-qobj branch June 27, 2024 10:01
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.

Type instabilities when generating a QuantumObject
2 participants