Skip to content

Commit

Permalink
Deep copy. Throw deep Baby!
Browse files Browse the repository at this point in the history
  • Loading branch information
CoherenceController committed Jul 25, 2018
1 parent 446ff4f commit adf51e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion QGL/Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os
import operator
from warnings import warn
from copy import copy
from copy import copy, deepcopy
from functools import reduce
from importlib import import_module
import json
Expand Down Expand Up @@ -325,6 +325,7 @@ def compile_to_hardware(seqs,
save_code(seqs, fileName + suffix)

# all sequences should start with a WAIT for synchronization
seqs = deepcopy(seqs)
for seq in seqs:
if not isinstance(seq[0], ControlFlow.Wait):
logger.debug("Adding a WAIT - first sequence element was %s", seq[0])
Expand Down
6 changes: 6 additions & 0 deletions QGL/PulseSequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def __mul__(self, other):
ptype = promote_type(self, other)
return self.promote(ptype) * other.promote(ptype)

def __copy__(self):
return self

def __deepcopy__(self, memo):
return self

def promote(self, ptype):
# promote a Pulse to a PulseBlock
return ptype(self)
Expand Down

0 comments on commit adf51e0

Please sign in to comment.