Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ba2tro committed Sep 13, 2023
1 parent f90a1ac commit 1d8771d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/backends/quantumoptics/quantumoptics.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QuantumOpticsBase
import QuantumOpticsBase: GenericBasis, CompositeBasis,
StateVector, AbstractSuperOperator, Ket, Operator,basis,
StateVector, AbstractSuperOperator, Ket, Operator,
basisstate, spinup, spindown, sigmap, sigmax, sigmay, sigmaz, destroy,
projector, identityoperator, embed, dm, expect, ptrace, spre, spost
import QuantumOptics
Expand Down
7 changes: 1 addition & 6 deletions src/baseops/apply.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ function apply!(regs::Vector{Register}, indices::Vector{Int}, operation; time=no
uptotime!(regs, indices, max_time)
subsystemcompose(regs,indices)
state = regs[1].staterefs[indices[1]].state[]
if (typeof(state) <: Ket) && !(basis(state)==basis(operation)) # e.g., performing a 2 qubit operation on a 4 qubit ket state
state_indices_app = [r.stateindices[i] for (r,i) in zip(regs, indices)] # state indices on which we are performing the op
state_indices = [idx for idx in 1:length(basis(state).bases) if idx state_indices_app] #state indices on which no op is performed
else
state_indices = [r.stateindices[i] for (r,i) in zip(regs, indices)]
end
state_indices = [r.stateindices[i] for (r,i) in zip(regs, indices)]
state = apply!(state, state_indices, operation)
regs[1].staterefs[indices[1]].state[] = state
regs, max_time
Expand Down

0 comments on commit 1d8771d

Please sign in to comment.