Skip to content

Commit

Permalink
Merge 4397351 into 838c65c
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Ristè committed Oct 16, 2019
2 parents 838c65c + 4397351 commit fbaffc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion QGL/PulsePrimitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,13 @@ def CNOT_simple(source, target, **kwargs):

@_memoize
def CNOT(source, target, **kwargs):
cnot_impl = globals()[config.cnot_implementation]
channel = ChannelLibraries.EdgeFactory(source, target)
if hasattr(channel, 'cnot_impl'):
cnot_impl_name = channel.cnot_impl
#print(f'Chosen CNOT implementation: {cnot_impl_name}')
else:
cnot_impl_name = config.cnot_implementation
cnot_impl = globals()[cnot_impl_name]
return cnot_impl(source, target, **kwargs)

# The worker method for MEAS and MEASA
Expand Down
2 changes: 1 addition & 1 deletion QGL/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# select a CNOT implementation (a name of a Pulse function that implements
# CNOT in your gate set, e.g. CNOT_simple or CNOT_CR)
cnot_implementation = "CNOT_simple"
cnot_implementation = "CNOT_CR"

def load_config():
global config_file
Expand Down

0 comments on commit fbaffc0

Please sign in to comment.