Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
aarontrowbridge committed Jun 20, 2023
1 parent 1cb67a8 commit 2926add
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/quantum_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ function qubit_system_state(ket::String)
return ψ
end

function lift(U, q, n; l=2)
Is = Matrix{Number}[I(l) for i in 1:n]
function lift(
U::AbstractMatrix{<:Number},
q::Int,
n::Int;
l::Int=2
)
Is = Matrix{Number}[I(l) for _ = 1:n]
Is[q] = U
return foldr(kron, Is)
end
Expand Down

0 comments on commit 2926add

Please sign in to comment.