ASCII-based visualization for quantum states and circuits.
This namespace provides text-based visualizations that can be displayed in terminals, REPLs, and simple text outputs. All functions return strings containing formatted ASCII art representations.
ASCII-based visualization for quantum states and circuits. This namespace provides text-based visualizations that can be displayed in terminals, REPLs, and simple text outputs. All functions return strings containing formatted ASCII art representations.
(add-gate-to-lines lines gate gate-pos gate-symbols)
Helper function to add a gate to the ASCII circuit lines.
Parameters:
Returns: Updated circuit lines with the gate added
Helper function to add a gate to the ASCII circuit lines. Parameters: - lines: Current circuit lines - gate: Gate definition map - gate-pos: Position of the gate in the circuit - gate-symbols: Sybmbols of the gates Returns: Updated circuit lines with the gate added
(format-complex-number z)
(format-complex-number z format precision)
(format-complex-number z format precision threshold)
Format a complex number for human-readable display.
Parameters:
Format a complex number for human-readable display. Parameters: - z: Complex number to format - format: :cartesian or :polar (default :cartesian) - precision: Number of decimal places (default 3) - threshold: Minimum amplitude to display (default 0.001) Returns: Formatted string representation of the complex number
(format-measurement-result measurements
&
{:keys [show-histogram show-probabilities]
:or {show-histogram true show-probabilities true}})
Format quantum measurement results for display.
Parameters:
Returns: Formatted string with statistics
Format quantum measurement results for display. Parameters: - measurements: Collection of measurement outcomes - options: Display options Returns: Formatted string with statistics
(format-outcome outcome)
Format a measurement outcome for display.
Parameters:
Returns: Formatted string representation of the outcome
Format a measurement outcome for display. Parameters: - outcome: Measurement outcome (e.g., |0⟩, |1⟩, etc.) Returns: Formatted string representation of the outcome
(format-quantum-state state
&
{:keys [precision threshold format]
:or {precision 3 threshold 0.001 format :cartesian}})
Format quantum state for human-readable display.
Parameters:
Returns: Formatted string representation
Format quantum state for human-readable display. Parameters: - state: Quantum state - options: Display options map :precision - Number of decimal places (default 3) :threshold - Minimum amplitude to display (default 0.001) :format - :cartesian or :polar (default :cartesian) Returns: Formatted string representation
(gate-symbols)
Map of gate types to their ASCII symbols. Used for circuit diagram visualization.
Map of gate types to their ASCII symbols. Used for circuit diagram visualization.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close