Skip to content

Commit

Permalink
Moved CliffordNumbers.subscript_string to a better place
Browse files Browse the repository at this point in the history
  • Loading branch information
brainandforce committed Feb 27, 2024
1 parent 522f784 commit ea06184
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/CliffordNumbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ encompasses all types that may be used to construct a `CliffordNumber`.
"""
const BaseNumber = Union{Real,Complex}

"""
CliffordNumbers.subscript_string(x::Number) -> String
Produces a string representation of a number in subscript format.
"""
function subscript_string(x::Number)
str = collect(string(x))
for (n,c) in enumerate(str)
('0' <= c <= '9') && (str[n] = c + 0x2050)
(c === '-') && (str[n] = '')
(c === '+') && (str[n] = '')
end
return String(str)
end

# Contains tools for working with Hamming weights of integers
include("hamming.jl")
# Tools for defining quadratic forms/metric signatures (convention may not be great)
Expand Down
15 changes: 15 additions & 0 deletions src/show.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@

#---Pretty printing methods for exported types-----------------------------------------------------#
"""
CliffordNumbers.subscript_string(x::Number) -> String
Produces a string representation of a number in subscript format.
"""
function subscript_string(x::Number)
str = collect(string(x))
for (n,c) in enumerate(str)
('0' <= c <= '9') && (str[n] = c + 0x2050)
(c === '-') && (str[n] = '')
(c === '+') && (str[n] = '')
end
return String(str)
end

"""
CliffordNumbers.to_basis_str(b::BitIndex; [label], [pseudoscalar])
Expand Down

0 comments on commit ea06184

Please sign in to comment.