Running out of letters: Pitfalls of Unicode?

It’s a silly question. Here is the dilemma. I’m sort of running out of letters in the sense that I would like to use A for two things in the same project: a float and a matrix. I would normally resolve the dilemma with a matrixA or floatA option. But since this makes long operations less easy to read and Julia has the power of unicode, I’m considering alternatives: Bolding the letter A, a common practice for vectors and matrices. Adding a modifier like a bar to my float. Any opinion?

Ā = 1.0
𝐀 = Array{Float64}([1,2])

𝐀 is obtained with \bfA
Ā is obtained with A\bar

I told you it was a silly question.

1 Like

Perhaps U+1F130 - a boxed A?

1 Like

Are you determined that you cannot use a for the scalar? What about AA for the matrix?

For unicode, maybe, \bbA, or the one that’s called \mathcal{A} in LaTeX, but which I don’t know how to typeset in Julia.

3 Likes

There are also all the alphas.

2 Likes

I second the lower case latin or greek for the scalar.

3 Likes

Thank for your suggestions! Well I have already used lower-case a and α (forgot to say). Capital α was my first thought, but it looks too similar to A: Α (\Alpha). I’m not sure which one is \mathcal{A}, but there’s 𝔸 (\bbA, that’s \mathbb{A} in LaTeX) and 𝒜 (\scrA) and 𝓐 (\bscrA) . Probably not great for a matrix. However, this one 𝒶 (\scra) would work for the scalar. It looks different enough from a:

a ≠ 𝒶

Thanks again. Now back to multiplying matrices! :joy:

\bba is lowercase, 𝕒, while 𝔸 is \bbA. I think \scrA is the one I was thinking of as \mathcal{A}. But you don’t think the latter is good for a matrix?

You didn’t come here for the answer “just name the scalar a”, right?

1 Like

I recall that the “doubled-line” letters such as \bbA used to be used when there was such a thing as a blackboard. Lecturers would write matrices in that way. But of course there were alternatives: underscore for vector, double underscore for matrix, etc.

1 Like

You’re right: I remember that. In high school at some point we were even forced to put arrows on top of vectors. I think a more common practice these days is to bolden the letters, but I find that less easy to distinguish visually (maybe it has to do with the dark theme I’m using). So far I find the greatest visual difference is obtained with 𝔸 (\bbA), 𝒜 (\scrA), and 𝒶 (\scra) or decorating with a bar, a hat or other squiggle, while bolding and italicizing don’t go quite far enough when you’re quickly scanning a document. :+1:

See also Mathematical Alphanumeric Symbols - Wikipedia

1 Like

That was my first reaction, but shortly after saying this, I started noticing that it’s used with great effect in some excellent code. It’s concise and very easy to identify visually. So I’ve basically changed my mind. I’ll change all my other matrices for consistency (because I do have B, C, and a few others). Thanks DNF! :+1: