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

Unable to take tensor product of outer products #53

Closed
apkille opened this issue Jun 24, 2024 · 1 comment
Closed

Unable to take tensor product of outer products #53

apkille opened this issue Jun 24, 2024 · 1 comment

Comments

@apkille
Copy link
Member

apkille commented Jun 24, 2024

julia> @ket k; @bra b;

julia> (k*b) ⊗ (k*b)
ERROR: MethodError: *(::SKet, ::SKet) is ambiguous.

Candidates:
  *(x::SymbolicUtils.Symbolic{T}, c) where T<:Union{QuantumInterface.AbstractBra, QuantumInterface.AbstractKet, QuantumInterface.AbstractOperator, QuantumInterface.AbstractSuperOperator}
    @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:34
  *(c, x::SymbolicUtils.Symbolic{T}) where T<:Union{QuantumInterface.AbstractBra, QuantumInterface.AbstractKet, QuantumInterface.AbstractOperator, QuantumInterface.AbstractSuperOperator}
    @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:33

Possible fix, define
  *(::SymbolicUtils.Symbolic{T}, ::SymbolicUtils.Symbolic{T}) where {T<:Union{…}, T<:Union{…}}

Stacktrace:
 [1] prefactorscalings(xs::Vector{SOuterKetBra}; scalar::Bool)
   @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/rules.jl:26
 [2] prefactorscalings
   @ ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/rules.jl:19 [inlined]
 [3] STensorOperator(terms::Vector{SOuterKetBra})
   @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:158
 [4] tensor(::SOuterKetBra, ::SOuterKetBra)
   @ QuantumSymbolics ~/Documents/Julia Packages/QuantumJulia/QuantumSymbolics.jl/src/QSymbolicsBase/basic_ops_homogeneous.jl:170
 [5] top-level scope
   @ REPL[4]:1
Some type information was truncated. Use `show(err)` to see complete types.
@apkille
Copy link
Member Author

apkille commented Jun 24, 2024

It seems that prefactorscalings attempts to factor out the objects in the outer products. Will address this issue in upcoming PR.

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

1 participant