{{ op.type }}
{% if box|get_box_matrix() is not none %}
{{ display_matrix(box.get_matrix()|format_raw_matrix) }}
{% elif op.type == "ExpBox" %}
{% set info = box|get_expbox_details %}
{{ display_matrix(info.matrix|format_raw_matrix) }}
Phase
{{ info.phase }}
{% elif op.type == "PauliExpBox" %}
Phase |
Paulis |
{{ box.get_phase() }} |
{{ display_list({ "chart":box.get_paulis() }) }}
|
{% elif op.type == "PhasePolyBox" %}
Encapsulating {{ box.n_qubits }} gates
Qubit Mapping
{{ display_list({ "chart": box.qubit_indices|format_mapping(coerce_from="register") }) }}
Phase Polynomial
{{ display_list({ "chart": box.phase_polynomial|format_mapping(coerce_from="bool") }) }}
Linear Transformation
{{ display_matrix(box.linear_transformation|format_bool_matrix, display_title=False) }}
{% elif op.type == "Custom" %}
Parameter |
Value |
{% for param in box.params %}
{{ box.gate.args[loop.index0] }} |
{{ param }} |
{% endfor %}
{% elif op.type == "ConditionalGate" %}
Condition value |
{{ op.raw.value }} |
{% elif op.type == "QControlBox" and box.get_op().type.name|has_sub_circuit %}
{# If there is a nested circuit display it #}
{% set sub_circuit = box.get_op()|get_sub_circuit %}
{% if sub_circuit is not none %}
Controlled Circuit
{{ render_circuit(
sub_circuit|parse_circuit,
options={"condensed": True, "recursive": False },
nested=True
) }}
{% endif %}
{% elif op.type == "ClassicalExpBox" %}
Expression
{{ box.get_exp().op|format_logic_exp }}
Input bits |
{{ box.get_n_i() }} |
Input/Output bits |
{{ box.get_n_io() }} |
Output bits |
{{ box.get_n_o() }} |
{% elif op.type|is_classical_gate %}
{% if box.get_name() %}
Operation |
{{ box.get_name() }} |
{% endif %}
{% if box.n_inputs %}
Input bits |
{{ box.n_inputs }} |
{% endif %}
{% if box.n_input_outputs %}
Input/Output bits |
{{ box.n_input_outputs }} |
{% endif %}
{% if box.n_outputs %}
Output bits |
{{ box.n_outputs }} |
{% endif %}
{% if box.values %}
Values |
{{ display_list({ "chart":box.values }) }}
|
{% endif %}
{% if box.upper %}
Upper |
{{ box.upper }} |
{% endif %}
{% if box.lower %}
Lower |
{{ box.lower }} |
{% endif %}
{% endif %}
{% if op.type|has_sub_circuit and not is_nested_circuit %}
{% set sub_circuit = op.raw|get_sub_circuit %}
{% if sub_circuit is not none %}
Gate as Circuit
{{ render_circuit(
sub_circuit|parse_circuit,
options={"condensed": True, "recursive": False },
nested=True
) }}
{% endif %}
{% endif %}