qutip / QuantumToolbox.jl

Quantum Toolbox in Julia
https://qutip.org/QuantumToolbox.jl/dev/
BSD 3-Clause "New" or "Revised" License
38 stars 15 forks source link

Add `Qobj` and `tensor` #14

Closed ytdHuang closed 8 months ago

ytdHuang commented 8 months ago

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

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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