qiskit/test/visual/mpl/circuit/references
Jake Lishman a78c94144c
Add minimal support for standalone `Var` to visualisers (#12307)
* Add minimal support for standalone `Var` to visualisers

This adds best-effort only support to the visualisers for handling
stand-alone `Var` nodes.  Most of the changes are actually in `qasm3`,
since the visualisers use internal details of that to handle the nodes.

This commit decouples the visualisers _slightly_ more from the inner
workings of the OQ3 exporter by having them manage their own
variable-naming contexts and using the encapsulated `_ExprBuilder`,
rather than poking into random internals of the full circuit exporter.
This is necessary to allow the OQ3 exporter to expand to support these
variables itself, and also for the visualisers, since variables may now
be introduced in inner scopes.

This commit does not attempt to solve many of the known problems around
zero-operand "gates", of which `Store` is one, just leaving it un-drawn.
Printing to OpenQASM 3 is possibly a better visualisation strategy for
large dynamic circuits for the time being.

* Fix typos

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
2024-05-01 22:49:24 +00:00
..
6095.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
annotated.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
barrier_label.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
big_gates.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
bit_conditional_bundle.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
bit_conditional_no_bundle.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
bw.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
calibrations.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
calibrations_with_control_gates.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
calibrations_with_rzz_and_rxx.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
calibrations_with_swap_and_reset.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
clifford_color.png Preparations to update the default MPL drawer style to ``"iqx"`` (#10950) 2023-10-18 11:45:49 +00:00
cnot.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
cond_bits_reverse.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
control_flow_fold_minus_one.png Fix mpl circuit drawer with fold=-1 hanging with ControlFlow ops (#12016) 2024-03-18 17:13:39 +00:00
creg_initial_false.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
creg_initial_true.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
cswap_rzz.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
ctrl_labels.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
cz.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
empty_circut.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
figwidth.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
fold_4.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
fold_minus1.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
fold_with_conditions.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
for_loop.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
for_loop_1_qarg.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
for_loop_range.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
ghz_to_gate.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
global_phase.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
idle_wires_barrier.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_else_body.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_else_op_false.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_else_op_fold.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_else_op_nested.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_else_op_textbook.png Add display of internal circuits for ControlFlowOps to mpl circuit drawer (#10207) 2023-07-20 17:11:53 +00:00
if_else_op_true.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_else_op_wire_order.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_else_standalone_var.png Add minimal support for standalone `Var` to visualisers (#12307) 2024-05-01 22:49:24 +00:00
if_op.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_op_expr.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
if_op_expr_nested.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
init_reset.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
instruction_1q_1c.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
instruction_3q_3c_circ1.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
instruction_3q_3c_circ2.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
instruction_3q_3c_circ3.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
iqp-dark_color.png Preparations to update the default MPL drawer style to ``"iqx"`` (#10950) 2023-10-18 11:45:49 +00:00
iqp_color.png Preparations to update the default MPL drawer style to ``"iqx"`` (#10950) 2023-10-18 11:45:49 +00:00
layout_control_flow.png Fix `GenericBackendV2` defaults (#11785) 2024-02-14 15:47:41 +00:00
long_name.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
meas_condition.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
measure_cond_bits_false.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
measure_cond_bits_right.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
measure_cond_bits_true.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
measure_cond_false.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
measure_cond_true.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
multi_underscore_false.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
multi_underscore_true.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
nested_layout_control_flow.png Fix `GenericBackendV2` defaults (#11785) 2024-02-14 15:47:41 +00:00
no_barriers.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
no_op_circut.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
one_bit_regs.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
partial_layout.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
pauli_clifford.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
pi_in_param_expr.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
plot_barriers_false.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
plot_barriers_true.png Remove ``qiskit.extensions`` (#11488) 2024-01-17 16:36:52 +00:00
plot_partial_barrier.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
qreg_names_after_layout.png Remove provider-specific fake backends,`FakeProvider` class and related tools in 1.0 (#11376) 2024-02-01 19:27:05 -05:00
r_gates.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
reg_conditional.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
registerless_one_bit.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
reverse_bits.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
reverse_bits_cond_false.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
reverse_bits_cond_true.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
scale_default.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
scale_double.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
scale_half.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
sidetext_condition.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
style_custom_gates.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
subfont.png move and enable visual tests (#9961) 2023-07-11 16:42:58 +00:00
switch_case.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
switch_case_1_qarg.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
switch_case_empty_default.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
switch_expr.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
switch_standalone_var.png Add minimal support for standalone `Var` to visualisers (#12307) 2024-05-01 22:49:24 +00:00
textbook_color.png Fix IQX color schemes (#10941) 2023-10-06 11:35:48 +00:00
user_ax.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
user_style.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
while_loop.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
wide_params.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00
wire_order.png Make ``iqp`` the matplotlib default style (#11536) 2024-01-15 13:21:11 +00:00