From b15007e97368d7151af1c1d89168bd84f347123d Mon Sep 17 00:00:00 2001 From: kmbys <55523468+kmbys@users.noreply.github.com> Date: Fri, 17 Jul 2026 04:21:25 +0000 Subject: [PATCH] Add barrier label rendering with barrier_label_len to the Rust circuit drawer Part of #16464. Ports the barrier label rendering of the Python text drawer (including the barrier_label_len truncation added in #15776) to the Rust circuit drawer. The label is drawn above the top-most wire of the barrier and truncated to barrier_label_len characters with a '...' suffix when it exceeds that length, matching the Python text drawer output character-for-character. The C API's QkCircuitDrawerConfig struct gains a barrier_label_len field; 0 selects the default of 16 characters, so existing initializers that omit the field keep the previous default behavior. Part of #16464 --- crates/cext/src/circuit.rs | 21 +- crates/circuit/src/circuit_drawer.rs | 254 +++++++++++++++--- ...er-barrier-label-len-9c41f4a2b8d51e07.yaml | 10 + test/c/test_circuit.c | 2 +- 4 files changed, 251 insertions(+), 36 deletions(-) create mode 100644 releasenotes/notes/rust-drawer-barrier-label-len-9c41f4a2b8d51e07.yaml diff --git a/crates/cext/src/circuit.rs b/crates/cext/src/circuit.rs index 22429250dd9c..86d4604b293c 100644 --- a/crates/cext/src/circuit.rs +++ b/crates/cext/src/circuit.rs @@ -26,7 +26,7 @@ use num_complex::{Complex64, ComplexFloat}; use qiskit_circuit::bit::{ClassicalRegister, QuantumRegister}; use qiskit_circuit::bit::{ShareableClbit, ShareableQubit}; use qiskit_circuit::circuit_data::{CircuitData, CircuitDataError}; -use qiskit_circuit::circuit_drawer::draw_circuit; +use qiskit_circuit::circuit_drawer::{DEFAULT_BARRIER_LABEL_LEN, draw_circuit}; use qiskit_circuit::dag_circuit::DAGCircuit; use qiskit_circuit::instruction::Parameters; use qiskit_circuit::interner::Interner; @@ -2443,6 +2443,10 @@ pub struct CircuitDrawerConfig { /// to auto-detect console width. Use `SIZE_MAX` to effectively skip /// wrapping altogether. fold: usize, + /// Sets the number of characters to display for barrier labels. If + /// this number is exceeded, the label is truncated at that number and + /// '...' is appended. Use 0 to apply the default of 16 characters. + barrier_label_len: usize, } /// @ingroup QkCircuit @@ -2454,6 +2458,7 @@ pub struct CircuitDrawerConfig { /// * ``bundle_cregs = true`` /// * ``merge_wires = true`` /// * ``fold = 0`` +/// * ``barrier_label_len = 16`` /// /// @return A pointer to a null-terminated string containing the circuit representation. /// You must use ``qk_str_free`` to release the allocated memory when done. @@ -2467,7 +2472,7 @@ pub struct CircuitDrawerConfig { /// qk_circuit_measure(circuit, 0, 0); /// qk_circuit_measure(circuit, 1, 0); /// -/// QkCircuitDrawerConfig config = {false, true, 0}; +/// QkCircuitDrawerConfig config = {false, true, 0, 16}; /// /// char *circ_str = qk_circuit_draw(circuit, &config); /// @@ -2489,7 +2494,7 @@ pub unsafe extern "C" fn qk_circuit_draw( // SAFETY: Per documentation, the pointer is non-null and aligned. let circuit = unsafe { const_ptr_as_ref(circuit) }; - let (bundle_cregs, merge_wires, fold) = if !config.is_null() { + let (bundle_cregs, merge_wires, fold, barrier_label_len) = if !config.is_null() { // SAFETY: Per documentation, the pointer is to a valid QkCircuitDrawerConfig struct. let config = unsafe { const_ptr_as_ref(config) }; ( @@ -2500,12 +2505,18 @@ pub unsafe extern "C" fn qk_circuit_draw( } else { None }, + if config.barrier_label_len != 0 { + config.barrier_label_len + } else { + DEFAULT_BARRIER_LABEL_LEN + }, ) } else { - (true, true, None) + (true, true, None, DEFAULT_BARRIER_LABEL_LEN) }; - let circuit_str = draw_circuit(circuit, bundle_cregs, merge_wires, fold).unwrap(); + let circuit_str = + draw_circuit(circuit, bundle_cregs, merge_wires, fold, barrier_label_len).unwrap(); CString::new(circuit_str).unwrap().into_raw() } diff --git a/crates/circuit/src/circuit_drawer.rs b/crates/circuit/src/circuit_drawer.rs index fd09e2c496a5..41594e6abfa6 100644 --- a/crates/circuit/src/circuit_drawer.rs +++ b/crates/circuit/src/circuit_drawer.rs @@ -28,6 +28,9 @@ use std::ops::Index; use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; +/// The default number of characters at which barrier labels are truncated. +pub const DEFAULT_BARRIER_LABEL_LEN: usize = 16; + /// Draw the [CircuitData] object as string. /// /// # Arguments: @@ -36,6 +39,8 @@ use unicode_width::UnicodeWidthStr; /// * cregbundle: If true, classical bits of classical registers are bundled into one wire. /// * mergewires: If true, adjacent wires are merged when rendered. /// * fold: If not None, applies line wrapping using the specified amount. +/// * barrier_label_len: The number of characters to display for barrier labels. If this +/// number is exceeded, the label is truncated at that number and '...' is appended. /// /// # Returns: /// @@ -45,10 +50,12 @@ pub fn draw_circuit( cregbundle: bool, mergewires: bool, fold: Option, + barrier_label_len: usize, ) -> PyResult { let vis_mat = VisualizationMatrix::from_circuit(circuit, cregbundle)?; - let text_drawer = TextDrawer::from_visualization_matrix(&vis_mat, cregbundle); + let text_drawer = + TextDrawer::from_visualization_matrix(&vis_mat, cregbundle, barrier_label_len); let fold = match fold { Some(f) => f, @@ -212,7 +219,7 @@ enum OnWireElement<'a> { Control(&'a PackedInstruction), CPhaseEndpoint(&'a PackedInstruction), Swap(&'a PackedInstruction), - Barrier, + Barrier(&'a PackedInstruction), Reset, } @@ -438,7 +445,8 @@ impl<'a> VisualizationLayer<'a> { match std_inst { StandardInstruction::Barrier(_) => { for q in qargs { - self.0[q.index()] = VisualizationElement::DirectOnWire(OnWireElement::Barrier); + self.0[q.index()] = + VisualizationElement::DirectOnWire(OnWireElement::Barrier(inst)); } } StandardInstruction::Reset => { @@ -653,7 +661,7 @@ impl Debug for VisualizationMatrix<'_> { WireInputElement::Creg(_) => "C/", }, VisualizationElement::DirectOnWire(on_wire) => match on_wire { - OnWireElement::Barrier => "░", + OnWireElement::Barrier(_) => "░", OnWireElement::Control(_) => "■", OnWireElement::Reset => "|0>", OnWireElement::Swap(_) => "x", @@ -814,13 +822,17 @@ impl Index for TextDrawer { } impl TextDrawer { - fn from_visualization_matrix(vis_mat: &VisualizationMatrix, cregbundle: bool) -> Self { + fn from_visualization_matrix( + vis_mat: &VisualizationMatrix, + cregbundle: bool, + barrier_label_len: usize, + ) -> Self { let mut text_drawer = TextDrawer { wires: vec![Vec::new(); vis_mat.num_wires()], }; for (i, layer) in vis_mat.layers.iter().enumerate() { - let layer_wires = Self::draw_layer(layer, vis_mat, cregbundle, i); + let layer_wires = Self::draw_layer(layer, vis_mat, cregbundle, i, barrier_label_len); for (j, wire) in layer_wires.iter().enumerate() { text_drawer.wires[j].push(wire.clone()); } @@ -910,6 +922,17 @@ impl TextDrawer { } } + /// Truncates a label to at most `max_len` characters, appending '...' when truncation occurs. + fn truncate_label(label: &str, max_len: usize) -> String { + if label.chars().count() > max_len { + let mut truncated: String = label.chars().take(max_len).collect(); + truncated.push_str("..."); + truncated + } else { + label.to_string() + } + } + /// Returns the Pauli term at input `idx` (or spaces if `idx` is None) for a PPR or PPM gate, /// or an empty string if `inst` is neither. fn try_pauli_term(idx: Option, inst: &PackedInstruction) -> &str { @@ -946,12 +969,15 @@ impl TextDrawer { vis_mat: &VisualizationMatrix, cregbundle: bool, layer_ind: usize, + barrier_label_len: usize, ) -> Vec { let mut wires: Vec = layer .0 .iter() .enumerate() - .map(|(i, element)| Self::draw_element(element, vis_mat, cregbundle, i)) + .map(|(i, element)| { + Self::draw_element(element, vis_mat, cregbundle, i, barrier_label_len) + }) .collect(); let num_qubits = vis_mat.circuit.num_qubits(); @@ -975,6 +1001,7 @@ impl TextDrawer { vis_mat: &VisualizationMatrix, cregbundle: bool, wire_idx: usize, + barrier_label_len: usize, ) -> TextWireElement { let circuit = vis_mat.circuit; let (top, mid, bot); @@ -1156,11 +1183,38 @@ impl TextDrawer { ), ) } - OnWireElement::Barrier => ( - format!(" {} ", BARRIER), - format!("{}{}{}", Q_WIRE, BARRIER, Q_WIRE), - format!(" {} ", BARRIER), - ), + OnWireElement::Barrier(inst) => { + // A barrier label is only drawn above the top-most wire of the barrier, + // truncated to `barrier_label_len` characters, matching the Python + // text drawer. + let (minima, _) = + get_instruction_range(circuit.get_qargs(inst.qubits), &[], 0); + let label = if wire_idx == minima { + inst.label.as_deref().filter(|label| !label.is_empty()) + } else { + None + }; + match label { + Some(label) => { + let label_top = + format!(" {} ", Self::truncate_label(label, barrier_label_len)); + let mut label_mid = format!("{}{}{}", Q_WIRE, BARRIER, Q_WIRE); + let mut label_bot = format!(" {} ", BARRIER); + TextWireElement::pad_string( + &mut label_mid, + Q_WIRE, + label_top.width(), + ); + TextWireElement::pad_string(&mut label_bot, ' ', label_top.width()); + (label_top, label_mid, label_bot) + } + None => ( + format!(" {} ", BARRIER), + format!("{}{}{}", Q_WIRE, BARRIER, Q_WIRE), + format!(" {} ", BARRIER), + ), + } + } OnWireElement::Reset => ( format!(" {} ", " "), format!("{}{}{}", Q_WIRE, "|0>", Q_WIRE), @@ -1572,7 +1626,7 @@ mod tests { fn test_creg_bundle() { let circuit = basic_circuit(); - let result = draw_circuit(&circuit, true, false, None).unwrap(); + let result = draw_circuit(&circuit, true, false, None, 16).unwrap(); let expected = " ┌───┐ @@ -1595,7 +1649,7 @@ c2: 2/══════════ fn test_merge_wires() { let circuit = basic_circuit(); - let result = draw_circuit(&circuit, false, true, None).unwrap(); + let result = draw_circuit(&circuit, false, true, None, 16).unwrap(); let expected = " ┌───┐ q_0: ┤ H ├──■── @@ -1645,7 +1699,7 @@ c2_1: ══════════ }; circuit.push(inst).unwrap(); - let result = draw_circuit(&circuit, false, false, Some(100)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); let expected = " ┌───┐┌─┐ q: ┤ H ├┤M├ @@ -1688,7 +1742,7 @@ c: ══════╩═ .push_standard_gate(StandardGate::H, &[], &[Qubit::new(1)]) .unwrap(); - let result = draw_circuit(&circuit, false, false, Some(100)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); let expected = " ┌───┐ q: ┤ H ├ @@ -1723,7 +1777,7 @@ cr_1: ═════ .push_standard_gate(StandardGate::CZ, &[], &[Qubit::new(0), Qubit::new(1)]) .unwrap(); - let result = draw_circuit(&circuit, false, false, Some(10)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(10), 16).unwrap(); let expected = " ┌───┐ » q_0: ┤ H ├──■──» @@ -1788,7 +1842,7 @@ c2_1: ══════════» let mut inst_clone = circuit.data()[0].clone(); inst_clone.label = Some(Box::new("my_ch".to_string())); circuit.push(inst_clone).unwrap(); - let result = draw_circuit(&circuit, false, false, Some(80)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(80), 16).unwrap(); let expected = " ┌────────────┐┌───────────────┐ q_0: ──■──┤0 Rxx(1.23) ├┤0 my_rxx(1.23) ├────■──── @@ -1917,7 +1971,7 @@ q_1: ┤ H ├┤1 ├┤1 ├┤ my_ch ├ py_op: OnceLock::new(), }; circuit.push(inst).unwrap(); - let result = draw_circuit(&circuit, false, false, Some(80)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(80), 16).unwrap(); let expected = " ┌─────────┐ ┌────────────────────┐┌──────────┐» q_0: ─────┤ Unitary ├──────────────────┤0 ├┤2 ├» @@ -1971,7 +2025,7 @@ q_3: ──────────────────────┤1 .collect::>(); circuit.push_standard_gate(op, ¶ms, &qubits).unwrap(); } - let result = draw_circuit(&circuit, false, false, Some(80)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(80), 16).unwrap(); let expected = " ┌───┐ ┌───────────┐ ┌─────┐ ┌─────┐ ┌───────────────────────┐ » q_0: ┤ Y ├──┤ Rx(3.141) ├──────┤ Sdg ├───┤ Tdg ├─┤ U3(3.141,3.141,3.141) ├──■───────» @@ -2058,7 +2112,7 @@ q_4: ───────────────────────── fn test_global_phase() { let mut circuit = basic_circuit(); circuit.set_global_phase_param(3.14.into()).unwrap(); - let result = draw_circuit(&circuit, true, false, None).unwrap(); + let result = draw_circuit(&circuit, true, false, None, 16).unwrap(); let expected = " global phase: 3.14 @@ -2085,7 +2139,7 @@ c2: 2/══════════ ParameterExpression::from_symbol(Symbol::standalone("ϕ".to_owned(), None)), ))) .unwrap(); - let result = draw_circuit(&circuit, true, false, Some(80)).unwrap(); + let result = draw_circuit(&circuit, true, false, Some(80), 16).unwrap(); let expected = " global phase: ϕ @@ -2127,7 +2181,7 @@ c2: 2/══════════ &[Qubit(0), Qubit(1)], ) .unwrap(); - let result = draw_circuit(&circuit, false, false, Some(100)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); let expected = " ┌─────────┐┌────────────┐┌─────────┐ q_0: ┤0 Rxx(a) ├┤0 my_rxx(a) ├┤0 Rzx(2) ├ @@ -2214,7 +2268,7 @@ q_1: ┤1 ├┤1 ├┤1 ├ circuit.push(inst).unwrap(); } - let result = draw_circuit(&circuit, false, false, Some(100)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); let expected = " ┌────────────────┐┌────────────────┐┌────────────────┐┌────────────────┐┌───────────────┐ ░ ░ » q_0: ─|0>─┤ Delay(2.1[ns]) ├┤ Delay(2.1[ps]) ├┤ Delay(2.1[us]) ├┤ Delay(2.1[ms]) ├┤ Delay(2.1[s]) ├─░──░─» @@ -2291,7 +2345,7 @@ c_3: ═════════════════════════ &[Qubit(0), Qubit(1)], ) .unwrap(); - let result = draw_circuit(&circuit, false, false, Some(100)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); let expected = " ┌─────────┐┌─────────────┐┌─────────┐ q_0: ┤0 Rxx(ϕ) ├┤0 μου_rxx(ϕ) ├┤0 Rzx(2) ├ @@ -2332,7 +2386,7 @@ q_1: ┤1 ├┤1 ├┤1 ├ &[Qubit(0), Qubit(1)], ) .unwrap(); - let result = draw_circuit(&circuit, false, false, Some(100)).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); let expected = " ┌───────────┐ ┌──────────────┐┌─────────┐ q_0: ──────────┤0 Rxx(🎩) ├────────────┤0 💶🔉(🎩) ├┤0 Rzx(2) ├ @@ -2385,7 +2439,7 @@ q_1: ┤ Ry(🎩) ├┤1 ├─┤ 💶🔉(🎩) ├─┤1 ) .unwrap(); - let result = draw_circuit(&circuit, true, true, None).unwrap(); + let result = draw_circuit(&circuit, true, true, None, 16).unwrap(); let expected = " global phase: 4π/5 ┌────────────┐ ┌────────────┐ ┌───────────────┐ @@ -2549,7 +2603,7 @@ q_1: ┤ Rz(1.2346e8) ├┤ Rx(0.12346) ├┤ Rx(1.2346e-5) ├┤ Rx(2π/3) ) .unwrap(); - let result = draw_circuit(&circuit, true, true, Some(80)).unwrap(); + let result = draw_circuit(&circuit, true, true, Some(80), 16).unwrap(); let expected = " ┌────────────┐┌──────────────┐ q_0: ────────────────┤0 Z ├┤0 Z ├ @@ -2632,7 +2686,7 @@ q_10: ──────────────────────── ) .unwrap(); - let result = draw_circuit(&circuit, true, true, Some(80)).unwrap(); + let result = draw_circuit(&circuit, true, true, Some(80), 16).unwrap(); let expected = " ┌───────────┐ qr_0: ┤0 I ├─────────────────── @@ -2667,7 +2721,7 @@ cr: 3/══════╩══════════╩══════ build(&mut circuit); - let result = draw_circuit(&circuit, false, mergewires, Some(100)).unwrap(); + let result = draw_circuit(&circuit, false, mergewires, Some(100), 16).unwrap(); assert_eq!(result, expected); } @@ -2765,4 +2819,144 @@ q_3: ┤ X ├─■─────────────────┤ X ├ }, ); } + + /// Builds a circuit with labeled barriers: an H gate, a barrier over all + /// three qubits labeled "short", a CX, and a barrier over the first two + /// qubits with a long label. + fn labeled_barrier_circuit() -> CircuitData { + let qubits = vec![ + ShareableQubit::new_anonymous(), + ShareableQubit::new_anonymous(), + ShareableQubit::new_anonymous(), + ]; + let mut circuit = CircuitData::new(Some(qubits), None, Param::Float(0.0)).unwrap(); + circuit + .push_standard_gate(StandardGate::H, &[], &[Qubit(0)]) + .unwrap(); + let inst = PackedInstruction { + op: StandardInstruction::Barrier(3).into(), + qubits: circuit.add_qargs(&[Qubit(0), Qubit(1), Qubit(2)]), + clbits: circuit.cargs_interner().get_default(), + params: None, + label: Some(Box::new("short".to_string())), + #[cfg(feature = "cache_pygates")] + py_op: OnceLock::new(), + }; + circuit.push(inst).unwrap(); + circuit + .push_standard_gate(StandardGate::CX, &[], &[Qubit(0), Qubit(1)]) + .unwrap(); + let inst = PackedInstruction { + op: StandardInstruction::Barrier(2).into(), + qubits: circuit.add_qargs(&[Qubit(0), Qubit(1)]), + clbits: circuit.cargs_interner().get_default(), + params: None, + label: Some(Box::new("a_very_long_barrier_label_here".to_string())), + #[cfg(feature = "cache_pygates")] + py_op: OnceLock::new(), + }; + circuit.push(inst).unwrap(); + circuit + } + + #[cfg(not(miri))] + #[test] + fn test_barrier_label_default_truncation() { + let circuit = labeled_barrier_circuit(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); + let expected = " + ┌───┐ short a_very_long_barr... +q_0: ┤ H ├───░─────■────────────░────────── + └───┘ ░ │ ░ + ░ ┌─┴─┐ ░ +q_1: ────────░───┤ X ├──────────░────────── + ░ └───┘ ░ + ░ +q_2: ────────░───────────────────────────── + ░ +"; + assert_eq!(result, expected.trim_start_matches('\n')); + } + + #[cfg(not(miri))] + #[test] + fn test_barrier_label_custom_truncation() { + let circuit = labeled_barrier_circuit(); + let result = draw_circuit(&circuit, false, false, Some(100), 5).unwrap(); + let expected = " + ┌───┐ short a_ver... +q_0: ┤ H ├───░─────■──────░───── + └───┘ ░ │ ░ + ░ ┌─┴─┐ ░ +q_1: ────────░───┤ X ├────░───── + ░ └───┘ ░ + ░ +q_2: ────────░────────────────── + ░ +"; + assert_eq!(result, expected.trim_start_matches('\n')); + } + + #[cfg(not(miri))] + #[test] + fn test_barrier_label_on_inner_wires() { + // The label is drawn above the top-most wire of the barrier, which is + // not necessarily the first wire of the circuit. + let qubits = vec![ + ShareableQubit::new_anonymous(), + ShareableQubit::new_anonymous(), + ShareableQubit::new_anonymous(), + ]; + let mut circuit = CircuitData::new(Some(qubits), None, Param::Float(0.0)).unwrap(); + let inst = PackedInstruction { + op: StandardInstruction::Barrier(2).into(), + qubits: circuit.add_qargs(&[Qubit(1), Qubit(2)]), + clbits: circuit.cargs_interner().get_default(), + params: None, + label: Some(Box::new("mylabel".to_string())), + #[cfg(feature = "cache_pygates")] + py_op: OnceLock::new(), + }; + circuit.push(inst).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); + let expected = " + +q_0: ───────── + + mylabel +q_1: ────░──── + ░ + ░ +q_2: ────░──── + ░ +"; + // Only strip the first newline of the raw string literal: the drawing + // itself starts with a blank line (the empty top row of `q_0`). + assert_eq!(result, expected.strip_prefix('\n').unwrap()); + } + + #[cfg(not(miri))] + #[test] + fn test_barrier_label_exact_boundary() { + // A label of exactly `barrier_label_len` characters is not truncated. + let qubits = vec![ShareableQubit::new_anonymous()]; + let mut circuit = CircuitData::new(Some(qubits), None, Param::Float(0.0)).unwrap(); + let inst = PackedInstruction { + op: StandardInstruction::Barrier(1).into(), + qubits: circuit.add_qargs(&[Qubit(0)]), + clbits: circuit.cargs_interner().get_default(), + params: None, + label: Some(Box::new("0123456789abcdef".to_string())), + #[cfg(feature = "cache_pygates")] + py_op: OnceLock::new(), + }; + circuit.push(inst).unwrap(); + let result = draw_circuit(&circuit, false, false, Some(100), 16).unwrap(); + let expected = " + 0123456789abcdef +q_0: ────────░───────── + ░ +"; + assert_eq!(result, expected.trim_start_matches('\n')); + } } diff --git a/releasenotes/notes/rust-drawer-barrier-label-len-9c41f4a2b8d51e07.yaml b/releasenotes/notes/rust-drawer-barrier-label-len-9c41f4a2b8d51e07.yaml new file mode 100644 index 000000000000..a2ea5662c5e4 --- /dev/null +++ b/releasenotes/notes/rust-drawer-barrier-label-len-9c41f4a2b8d51e07.yaml @@ -0,0 +1,10 @@ +--- +features_c: + - | + The Rust circuit drawer now renders :class:`.Barrier` labels, matching the + behavior of the Python text drawer. A new ``barrier_label_len`` field on + :c:struct:`QkCircuitDrawerConfig` controls the number of characters to + display for barrier labels; longer labels are truncated at that length and + ``"..."`` is appended. Setting the field to ``0`` applies the default + truncation length of 16 characters, so existing initializers that omit the + field keep the default behavior. diff --git a/test/c/test_circuit.c b/test/c/test_circuit.c index a5a2ffc8724f..5cd1d17d600b 100644 --- a/test/c/test_circuit.c +++ b/test/c/test_circuit.c @@ -1190,7 +1190,7 @@ static int test_circuit_draw(void) { QkPauliProductMeasurement ppm = {z, x, 4, true}; qk_circuit_pauli_product_measurement(circuit, &ppm, qubits, 0); - QkCircuitDrawerConfig config = {false, true, 80}; + QkCircuitDrawerConfig config = {false, true, 80, 16}; char *circ_str = qk_circuit_draw(circuit, &config);