You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good idea, though I'm not sure how we would avoid this clashing with the basis rotation function"
functiongate(::GateName{gn}; kwargs...) where {gn}
gn_st =String(gn)
ifstartswith(gn_st, "basis")
GN =GateName(replace(gn_st, "basis"=>""))
returneigenbasis(GN; kwargs...)
endreturnerror(
"A gate with the name \"$gn\" has not been implemented yet. You can define it by overloading `gate(::GateName\"$gn\") = [...]`.",
)
end
We could put the call to gate(alias(gn); kwargs...) within that function, but that could lead to infinite loops so we would need to design it carefully.
See here for example: https://github.com/ITensor/ITensors.jl/blob/fb9b73a08513bd677fa9e0d81c81ea17e4582c24/src/physics/site_types/electron.jl#L79-L88
This should allow us to simplify the code. For example, we could define a single fallback definition:
which would automatically look for an alias of a gate name, so that we don't have to explicitly define overloads of
gate
for every new alias.The text was updated successfully, but these errors were encountered: