diff --git a/src/QSymbolicsBase/literal_objects.jl b/src/QSymbolicsBase/literal_objects.jl index a01cfd4..ed9369e 100644 --- a/src/QSymbolicsBase/literal_objects.jl +++ b/src/QSymbolicsBase/literal_objects.jl @@ -140,8 +140,7 @@ Base.show(io::IO, x::SKet) = print(io, "|$(symbollabel(x))⟩") Base.show(io::IO, x::SBra) = print(io, "⟨$(symbollabel(x))|") Base.show(io::IO, x::Union{SOperator,SHermitianOperator,SUnitaryOperator,SHermitianUnitaryOperator}) = begin symbol_name = String(symbollabel(x)) - middle_index = (length(symbol_name) + 1) ÷ 2 - print(io, symbol_name[1:middle_index-1] * symbol_name[middle_index] * "\u0302" * symbol_name[middle_index+1:end]) # add hat to the middle character + print(io, symbol_name[1:1] * "\u0302" * symbol_name[2:end]) # add hat to the first character end Base.show(io::IO, x::SymQObj) = print(io, symbollabel(x)) # fallback that probably is not great