-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hello
For my research, I compile some kernels in OpenQL, which then I'll simulate in quantumsim.
However, I need to make sure that the gate scheduling provided by OpenQL and the one fed to quantumsim are the same.
To make sure of this, I tried, for each quantum operation, to specify the timestamp using the time argument in
b.add_gate(gate, time = ... )
I made sure to introduce the gates in the middle of their duration, and measurements at 1/4 of their duration.
However, I noticed that, for very simple examples (where scheduling shouldn't be a problem), I still get different results, depending on whether I provide the gate timestamp or not:
b = Builder(setup)
b.add_gate('Measure', ["2"], output_bit = "2_out")
b.finalize()
b.circuit.gates
yields:
[<quantumsim.circuit.ButterflyGate at 0x218d1a744e0>,
<quantumsim.circuit.AmpPhDamp at 0x218d1a74a90>,
<quantumsim.circuit.Measurement at 0x218d1a743c8>,
<quantumsim.circuit.AmpPhDamp at 0x218d1a74be0>,
<quantumsim.circuit.ButterflyGate at 0x218d1a74c88>,
<quantumsim.circuit.AmpPhDamp at 0x218d1a74cc0>,
<quantumsim.circuit.AmpPhDamp at 0x218d1a746d8>]
While if I put the pass the time argument time = 150 (which is the time that one could get on the example above by checking b.circuit.gates[2].time )
b = Builder(setup)
b.add_gate('Measure', ["2"], output_bit = "2_out", time = 150)
b.finalize()
b.circuit.gates
Then this yields:
[<quantumsim.circuit.ButterflyGate at 0x218d1a399b0>,
<quantumsim.circuit.Measurement at 0x218d1a98a90>,
<quantumsim.circuit.ButterflyGate at 0x218d1a39c88>]
Why is this behaviour different?
I'm afraid that if I don't provide the time argument for all the gates, that the scheduling that qsoverlay calculates might be different than the one calculated by OpenQL.
How can I make sure that the timestamps are the same, while still benefiting from the more complete model provided by the 1st example (where I did not provide the timestamp)?