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

Element type conversion for QuantumObject #78

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

ytdHuang
Copy link
Member

@ytdHuang ytdHuang commented Apr 23, 2024

Support the following type conversion:

using QuantumToolbox
v = Qobj(Int64[1, 1])
m = Qobj(Int64[1, 1])

Vector{ComplexF64}(v)
Matrix{ComplexF64}(m)

and so does SparseVector and SparseMatrixCSC

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.15%. Comparing base (e59c415) to head (0c5b9cb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   91.87%   92.15%   +0.27%     
==========================================
  Files          18       18              
  Lines        1711     1721      +10     
==========================================
+ Hits         1572     1586      +14     
+ Misses        139      135       -4     

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

Copy link
Member

@albertomercurio albertomercurio left a comment

Choose a reason for hiding this comment

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

Great feature!

@albertomercurio
Copy link
Member

I would say also to add the sparse command. I don't remember that this is already implemented, right?

@ytdHuang
Copy link
Member Author

I would say also to add the sparse command. I don't remember that this is already implemented, right?

You mean dense_to_sparse ?

@albertomercurio
Copy link
Member

Mmmm ok, there is already dense_to_sparse. We can merge it as it is

@albertomercurio albertomercurio merged commit 7f98c8e into qutip:main Apr 23, 2024
13 checks passed
@ytdHuang ytdHuang deleted the dev/QO-convert branch April 23, 2024 15:11
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