I'm in a quantum mechanics class, where people started using expressions such as: "operators $\hat{x}$ and $\hat{p}$ commute to $i\hbar$", to mean "$\hat{x}\hat{p}-\hat{p}\hat{x}\equiv[\hat{x},\hat{p}]=i\hbar$". I always thought that "commuting" referred to a property of binary operations (not their operands), and that either the binary operation commutes, or it doesn't, but it never "commutes to something" (else than 0).
I can understand how the word "commute" is used in physics very well, but I was wondering if the same would be acceptable in maths, or if it would be flagged as an abuse of language?
Also, if "commuting" refers to a binary operation, is there in maths a distinction between elements that "commute or "don't commute" for the same operation? For example, if the binary operation is matrix multiplication over the set of square matrices of size 2, some elements "commute" (diagonal matrices), while in general 2 matrices will not "commute".
Saying that an operation $\star$ on a set $S$ is commutative amounts to sayig $a \star b = b\star a$ for all $a, b \in S$. This is typically phrased as saying that all elements in $S$ commute. If we didn't have to worry about commutativity on the level of individual elements, it would be silly to even describe an operation as commutative!
So yes, in math (particularly algebra) it's quite common to talk of individual elements commuting with one another (or mentioning that they don't).
I will say that the phrase commute to $X$ is new to me, but I don't find it terribly surprising, or offensive to my math sensibilities in the slightest.
To answer your second question: Given a group $G$ and an element $g \in G$, there are several important definitions involving elements commuting.
At the group level, we have the centralizer of $G$, defined as $Z(G) = \{x \in G: xy = yx \text{ for all }y \in G\}$; these are the things in $G$ that commute with everything. If it happens that $Z(G) = G$, we say that $G$ is commutative (since groups are assumed to only have a single binary operation we don't mention the operation), or more often, that it's abelian.
On the level of elements, we can define the centralizer of a specific element; $C(g) = \{x \in G: gx = xg\}$. These are all group elements that commute with a fixed group element.