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

Add Qobj and tensor #14

Closed
3 tasks done
ytdHuang opened this issue Feb 1, 2024 · 3 comments
Closed
3 tasks done

Add Qobj and tensor #14

ytdHuang opened this issue Feb 1, 2024 · 3 comments

Comments

@ytdHuang
Copy link
Member

ytdHuang commented Feb 1, 2024

To make the syntax more similar to QuTiP, I suggest to add the following function support:

  • Qobj(A; kwargs...) = QuantumObject(A; kwargs...) : This is just for us to create QuantumObject in a lazy way (and more similar to QuTiP). (f3c95b5)
  • tensor(A...) = kron(A...) : does the same thing as kron (9949e38)
  • ⊗(A, B) = kron(A, B) : take advantage of QuantumOptics (9949e38)

The last support allows us to express tensor(A, B, C) as A ⊗ B ⊗ C.

If @albertomercurio agrees with this, I can make a PR for this issue.

@albertomercurio
Copy link
Member

Thank you for submitting this issue.

The proposed changes are reasonable. We can even try to change all QuantumObjects to Qobj, which could be implemented using a simple ctrl+f and then substituting. In this way, we will never deal with QuantumObject anymore.

@ytdHuang
Copy link
Member Author

ytdHuang commented Feb 2, 2024

Thank you for submitting this issue.

The proposed changes are reasonable. We can even try to change all QuantumObjects to Qobj, which could be implemented using a simple ctrl+f and then substituting. In this way, we will never deal with QuantumObject anymore.

I have made a PR as shown above.

For the substitution of QuantumObject to Qobj, I didn't do this in the beginning because Julia language's naming rule prefer not to use the abbreviation.
In this PR, the new function is really defined as:

Qobj(A; kwargs...) = QuantumObject(A; kwargs...)

That means it is just passing all the args to QuantumObject() directly, and QuantumObject() will still handle all the types and other stuffs.

For me, I think defining Qobj is convenient, and QuantumObject looks nice and clear. So I like them both~

@albertomercurio
Copy link
Member

I agree with you. Let's merge it with with both of them.

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

No branches or pull requests

2 participants