Supported global options¶
This section lists all the global options currently supported by OpenQL.
Note
Most of these options exist only for backward compatibility, having been superseded by pass options. They will be used only when the pass list is automatically generated to mimic legacy behavior, or when compatibility mode is enabled in the compiler configuration file.
log_level
¶
Must be one of LOG_NOTHING
, LOG_CRITICAL
, LOG_ERROR
, LOG_WARNING
,
LOG_INFO
, or LOG_DEBUG
, default LOG_NOTHING
. Log levels
use_default_gates
¶
Must be yes
or no
, default yes
. Use default gates or not. When set, a
number of builtin gates become available as fallback for the gates defined in
the platform configuration structure, including the special wait and barrier
gates.
decompose_toffoli
¶
Must be one of no
, NC
, or AM
, default no
. Controls the behavior of
Kernel.toffoli(); either decompose immediately via the given substitution, or
insert the Toffoli gate into the circuit as-is if no
or unspecified.
issue_skip_319
¶
Must be yes
or no
, default no
. Issue skip instead of wait in bundles.
TODO: document better, and actually fix skip vs. wait/barrier properly once and
for all.
unique_output
¶
Must be yes
or no
, default no
. Uniquify the program name as used for
constructing output filenames, such that compiling the same program multiple
times yields a different name each time. When this option is set during the
first construction of a program with a particular name, the program name is used
as-is, and a <program>.unique file is generated in the output directory to track
how many times a program with this name has been constructed. When a program
with the same name is constructed again later, again with this option set, a
numeric suffix will be automatically added to the program name, starting from 2.
The generated suffix can be reset by simply removing the .unique file. Note that
the uniquified name is only used when %N is used in the output_prefix
common
pass option.
clifford_prescheduler
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether to run the Clifford optimizer before the
prescheduler.
prescheduler
¶
Must be yes
or no
, default yes
. When no compiler configuration file is
specified, this controls whether a basic ASAP/ALAP scheduler without resource
constraints should be run before mapping.
clifford_postscheduler
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether to run the Clifford optimizer after the
prescheduler.
clifford_premapper
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether to run the Clifford optimizer before the
mapper.
clifford_postmapper
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether to run the Clifford optimizer after the mapper.
output_dir
¶
Must be any string, default test_output
. When no compiler configuration file
is specified, this controls the output_prefix
option for all passes; it will
be set to <output_dir>/%N_%P
. Defaults to test_output
for compatibility
reasons. The directory will automatically be created if it does not already
exist when the first output file is written.
write_qasm_files
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this enables writing cQASM files before and after each default pass.
When a compiler configuration file is specified, use the debug
pass option
common to all passes instead.
write_report_files
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this enables writing statistics report files before and after each
default pass. When a compiler configuration file is specified, use the debug
pass option common to all passes instead.
scheduler
¶
Must be one of ASAP
or ALAP
, default ALAP
. When no compiler configuration
file is specified, this controls whether ALAP or ASAP scheduling is to be used
for the default-inserted scheduler passes. Both the pre-mapping and post-mapping
schedulers are affected.
scheduler_uniform
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether uniform scheduling should be done instead of
ASAP/ALAP (i.e. the scheduler
option will be ignored). Both the pre-mapping
and post-mapping schedulers are affected. Setting this selects the old scheduler
(sch.Schedule
), because the new scheduler (sch.ListSchedule
) doesn’t support
uniform scheduling.
scheduler_heuristic
¶
Must be one of path_length
or random
, default path_length
. When no
compiler configuration file is specified, this controls what scheduling
heuristic should be used for ordering the list of available gates by
criticality. These are the heuristics for the old scheduler (sch.Schedule
), so
setting this option will prevent the new scheduler (sch.ListSchedule
) from
being used. To set the heuristic for the new scheduler, you must use its pass
options directly; there is no global option for this.
scheduler_commute
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether the default-inserted scheduler passes are
allowed to commute CZ and CNOT gates. This also affects the mapper.
scheduler_commute_rotations
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether the default-inserted scheduler passes are
allowed to commute single-qubit X and Z rotations. This also affects the mapper.
print_dot_graphs
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, this controls whether data dependency/schedule graphs should be
written by default-inserted scheduler passes. The DOT file format is used as
output format.
initialplace
¶
Must be one of no
, yes
, 1s
, 10s
, 1m
, 10m
, 1h
, 1sx
, 10sx
,
1mx
, 10mx
, or 1hx
, default no
. When no compiler configuration file is
specified, this controls whether the MIP-based initial placement algorithm
should be run before running the heuristic mapper. A timeout can be specified,
as listed in the allowable values. If the timeout value ends in an ‘x’,
compilation fails if the timeout is hit; otherwise, heuristic mapping is
performed instead.
initialplace2qhorizon
¶
Must be an integer between 0 and 100 inclusive, default 0
. When no compiler
configuration file is specified, this controls how many two-qubit gates the
MIP-based initial placement pass (if any) considers for each kernel. If 0 or
unspecified, all gates are considered.
mapper
¶
Must be one of no
, base
, baserc
, minextend
, minextendrc
, or
maxfidelity
, default no
. When no compiler configuration file is specified,
this controls whether the heuristic mapper will be run, and if so, which
heuristic it should use. When no
, MIP-based placement is also disabled.
mapmaxalters
¶
Must be an integer less than or equal to 0, default 0
. When no compiler
configuration file is specified, this controls whether the heuristic mapper will
be run, and if so, how many alternative routing solutions it should generate
before picking one via the heuristic or tie-breaking method. 0 means unlimited.
mapinitone2one
¶
Must be yes
or no
, default yes
. When no compiler configuration file is
specified, and the mapper is enabled, this controls whether the mapper should
assume that each kernel starts with a one-to-one mapping between virtual and
real qubits. When disabled, the initial mapping is treated as undefined.
mapassumezeroinitstate
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, and the mapper is enabled, this controls whether the mapper should
assume that each qubit starts out as zero at the start of each kernel, rather
than with an undefined state.
mapprepinitsstate
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, and the mapper is enabled, this controls whether the mapper may
assume that a user-written prepz gate actually leaves the qubit in the zero
state, rather than any other quantum state. This allows it to make some
optimizations.
maplookahead
¶
Must be one of no
, 1qfirst
, noroutingfirst
, or all
, default
noroutingfirst
. When no compiler configuration file is specified, and the
mapper is enabled, this controls the lookahead_mode
option for the mapper,
controlling the strategy for selecting the next gate(s) to map. Refer to the
mapper pass documentation for lookahead_mode
for more information.
mappathselect
¶
Must be one of all
, borders
, or random
, default all
. When no compiler
configuration file is specified, and the mapper is enabled, this controls
whether to consider all paths from a source to destination qubit while routing,
or to favor routing along the borders of the search space. The latter is only
supported when the qubits are given planar coordinates in the topology section
of the platform configuration file. Both all
and random
consider all paths,
but for the latter the order in which the paths are generated is shuffled, which
is useful to reduce bias when max_alternative_routes
is used.
mapselectswaps
¶
Must be one of one
, all
, or earliest
, default all
. When no compiler
configuration file is specified, and the mapper is enabled, this controls how
routing interacts with speculation. Whenall
, all swaps for a particular
routing option are committed immediately, before trying anything else. When
one
, only the first swap in the route from source to target qubit is
committed. When earliest
, the swap that can be done at the earliest point is
selected, which might be the one swapping the source or target qubit.
maprecNN2q
¶
Must be yes
or no
, default no
. When no compiler configuration file is
specified, and the mapper is enabled, this controls the
recurse_on_nn_two_qubit
option for the mapper; i.e. whether to “recurse” on
nearest-neighbor two-qubit gates. NOTE: this is an advanced/unstable option;
don’t use it unless you know what you’re doing. May be removed or changed in a
later version of OpenQL.
mapselectmaxlevel
¶
Must be an integer between 0 and 10 inclusive or inf, default 0
. When no
compiler configuration file is specified, and the mapper is enabled, this
controls the maximum recursion depth while searching for alternative mapping
solutions. NOTE: this is an advanced/unstable option; don’t use it unless you
know what you’re doing. May be removed or changed in a later version of OpenQL.
mapselectmaxwidth
¶
Must be one of min
, minplusone
, minplushalfmin
, minplusmin
, or all
,
default min
. When no compiler configuration file is specified, and the mapper
is enabled, this limits how many alternative mapping solutions are considered.
min
means only the best-scoring alternatives are considered, minplusone
means the best scoring alternatives plus one more are considered,
minplushalfmin
means 1.5x the number of best-scoring alternatives are
considered, minplusmin
means 2x, and all
means they are all considered.
NOTE: this is an advanced/unstable option; don’t use it unless you know what
you’re doing. May be removed or changed in a later version of OpenQL.
maptiebreak
¶
Must be one of first
, last
, random
, or critical
, default random
. When
no compiler configuration file is specified, and the mapper is enabled, this
controls how to tie-break equally-scoring alternative mapping solutions. first
and last
choose respectively the first and last solution in the list (assuming
the qubits have planar coordinates specified in the topology section, first
selects the left-most alternative with the two-qubit gate near target, and
last
selects the right-most alternative with the two-qubit gate near source;
when no coordinates are given the choice is undefined, though deterministic),
random
uses random number generation to select an alternative, and critical
favors the alternative that maps the most critical gate as determined by the
scheduler (if any).
mapusemoves
¶
Must be an integer between 0 and 20 inclusive or one of no
or yes
, default
yes
. When no compiler configuration file is specified, and the mapper is
enabled, this controls if/when the mapper inserts move gates rather than swap
gates to perform routing. If no
, swap gates are always used. Otherwise, a move
gate is used if the other qubit has been initialized, or if initializing it only
extends the circuit by the given number of cycles. yes
implies this limit is 0
cycles.
mapreverseswap
¶
Must be yes
or no
, default yes
. When no compiler configuration file is
specified, and the mapper is enabled, this controls whether the mapper will
reverse the operands for a swap gate when reversal improves the schedule. NOTE:
this currently assumes that the second qubit operand of the swap gate
decomposition in the platform configuration file is used before than the first
operand; if this is not the case, enabling this will worsen the routing result
rather than improve it.
quantumsim
¶
Must be one of no
, default no
. Quantumsim output is no longer supported by
OpenQL. This option only exists to not break existing code that sets the option
to no
.
cz_mode
¶
Must be one of manual
or auto
, default manual
. This option is no longer
used by OpenQL. It’s just there to not break existing code that sets the option.
scheduler_post179
¶
Must be yes
or no
, default yes
. This option is no longer used by OpenQL.
It’s just there to not break existing code that sets the option.
optimize
¶
Must be yes
or no
, default no
. This option is no longer used by OpenQL.
It’s just there to not break existing code that sets the option.
generate_code
¶
Must be yes
or no
, default yes
. This option is no longer used by OpenQL.
It’s just there to not break existing code that sets the option.