Skip to content

Commit f3b4e21

Browse files
committed
operations at the same time
1 parent 90cd7c6 commit f3b4e21

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/circuit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function qiskitRepresentation(circuit::Circuit)
163163
ptr = circuit.operationPointers[j]
164164
# only apply the k-th instruction of the operation, if deep enough
165165
if k <= depth(circuit.operations[ptr])
166-
applyToQiskit!(qc, circuit.operations[ptr], Val(k), circuit.operationPositions[j]...)
166+
applyToQiskit!(qc, circuit.operations[ptr], k, circuit.operationPositions[j]...)
167167
end
168168
end
169169
end

src/operations.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@ function applyToQiskit!(qc::Qiskit.QuantumCircuit, operation::Operation, positio
2525
throw(ArgumentError("applyToQiskit not implemented for $(typeof(operation)). Please implement this method for your custom operation."))
2626
end
2727

28+
function applyToQiskit!(qc::Qiskit.QuantumCircuit, operation::Operation, ::Val, position::Vararg{Integer})
29+
throw(ArgumentError("operation dosent have this many steps."))
30+
end
31+
2832
function connectionGraph(operation::Operation)
2933
throw(ArgumentError("connectionGraph not implemented for $(typeof(operation)). Please implement this method for your custom operation."))
3034
end
3135

36+
function depth(operation::Operation)
37+
throw(ArgumentError("depth not implemented for $(typeof(operation)). Please implement this method for your custom operation."))
38+
end
39+
3240
include("operations/ZZ.jl")
3341
include("operations/XX.jl")
3442
include("operations/YY.jl")

0 commit comments

Comments
 (0)