Dashboard Core — State Visuals¶
Native statevector visualizations — histogram, Q-sphere, per-qubit Bloch spheres — pure matplotlib/numpy, no Qiskit anywhere.
state_visuals ¶
Native statevector visualizations -- histogram, Q-sphere, per-qubit Bloch spheres -- pure matplotlib/numpy, no Qiskit anywhere. Replaces qiskit.visualization.{plot_histogram, plot_state_qsphere, plot_bloch_multivector}, the last three real Qiskit call sites in this project's dashboard (the circuit diagram itself was already native, see circuit_diagram.py's own docstring for why that mattered on macOS). Qiskit's own instability on macOS CI runners was never proven scoped to just QuantumCircuit -- no reason the plotting functions built on top of it are exempt -- so removing them entirely, not just making qiskit optional, is the actual fix.
All inputs use Qiskit's little-endian bit convention (qubit 0 = least significant bit of the statevector index), matching dashboard_core.engine's own SimulationResult.statevector -- the same convention plot_state_qsphere/plot_bloch_multivector assumed.
native_histogram_figure ¶
Bar chart of shot counts, bitstrings sorted ascending -- the same information qiskit.visualization.plot_histogram showed, built from nothing but the counts dict itself.
Source code in tools/dashboard_core/state_visuals.py
native_bloch_multivector_figure ¶
One Bloch sphere per qubit, each from that qubit's own reduced density matrix (partial trace over every other qubit) -- the same per-qubit view qiskit.visualization.plot_bloch_multivector showed, computed directly from the real statevector, no Qiskit involved.
Source code in tools/dashboard_core/state_visuals.py
native_qsphere_figure ¶
Q-sphere: every basis state with non-negligible probability placed on a sphere by Hamming weight (latitude -- |00...0> at the north pole, |11...1> at the south pole, states of equal weight sharing a ring), marker size by probability, marker color by phase (cyclic colormap, matching Qiskit's own convention) -- the same encoding qiskit.visualization.plot_state_qsphere used, built directly from the statevector's own amplitudes.
Source code in tools/dashboard_core/state_visuals.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
See also: dashboard_core.visuals, which
aggregates this with circuit_diagram.