Skip to content

Commit

Permalink
Modify GST code for newest pygsti stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
gribeill committed Jul 25, 2019
1 parent 0bb95b5 commit 66191ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions QGL/GSTTools.py
Expand Up @@ -28,7 +28,7 @@

PYGSTI_PRESENT = False
try:
from pygsti.objects import GateString
from pygsti.objects.circuit import Circuit
PYGSTI_PRESENT = True
except:
pass
Expand All @@ -51,11 +51,11 @@ def gst_map_1Q(gst_list, qubit, qgl_map=gst_gate_map, append_meas=True):
Returns:
QGL sequences, preserving the input list nesting (as a generator)
"""
if isinstance(gst_list, GateString):
if isinstance(gst_list, Circuit):
gst_list = [gst_list]
for item in gst_list:
if isinstance(item, GateString):
mapped = map(lambda x: qgl_map[x](qubit), item.tup)
if isinstance(item, Circuit):
mapped = map(lambda x: qgl_map[str(x)](qubit), item.tup)
if append_meas:
yield list(chain(mapped, [MEAS(qubit)]))
else:
Expand Down

0 comments on commit 66191ce

Please sign in to comment.