Let $ \mathcal{O}$ be an order in a totally real number field $E$, then $( \mathcal{O},q_1 )$ is an integral lattice with its natural quadratic form $q_1(x):=\text{tr}_{E/\mathbb{Q}}(x^2)$ (which is positive definite). Also, if $u$ is a totally positive unit in $ \mathcal{O}$, then the form $ q_2(x):=\text{tr}_{E/\mathbb{Q}}(u \,x^2)$ give us another positive definite lattice $( \mathcal{O},q_2 )$.
When $u$ is a square unit, say $u=v^2$, this lattices are actually isometric by the map $\phi:( \mathcal{O},q_1 )\rightarrow( \mathcal{O},q_2 )$ given by $x \mapsto v^{-1} x$. Now, I've been trying (for a while) to deal with the reciprocal question, i.e.,
If there exists an isometry $\phi:( \mathcal{O},q_1 )\rightarrow( \mathcal{O},q_2 )$, then must $u$ be a square ?.
So far all I've been able to say is that if exist $\kappa \in \mathcal{O}$ such that $\phi(x)=\kappa \, x$ for all $x\in \mathcal{O} $, then $\text{tr}_{E/\mathbb{Q}}(x^2)=\text{tr}_{E/\mathbb{Q}}(u \, \kappa^2 x^2)$ implies $\text{tr}_{E/\mathbb{Q}}((1-u \, \kappa^2) x^2)=0 \,\, \forall x \in \mathcal{O} $, but then $1-u \, \kappa^2$ would be $q_1-$orthogonal to all $\mathcal{O}$ and therefore $u=\kappa^{-2}$, however I have no idea how to prove (or if it is even possible to prove) that $\phi$ must be of this form for some $\kappa$.
I'm especially interested in the case where $E$ is an $S_3$ cubic field (its normal closure has Galois group $S_3$). I haven't been able to find any counterexamples in this setting, I'd be more than grateful if someone could give some idea of how to find one.
I also would like to know if there are some reference where to find things related to this sort of problems. Thanks in advance!.
Update: Although quadratic fields it's not my purpose I realized that there at least two $n$ for which the question is false for the quadratic field $E=\mathbb{Q}(\sqrt{n})$ and maximal order $\mathcal{O}=\mathcal{O}_E$. These are $n=3,7$ with nonsquare units $u$ equal to $2+\sqrt{3}$ and $8+3\sqrt{7}$ respectively.
Indeed, the Gramm matrix of $q_i$ ($i=1,2$) always have determinant equal to $\text{disc}(\mathcal{O})$, thus $\frac{1}{2}q_i$ is a primitive form of discriminant $-4 n$ in both cases, and thefore it correspond to an ideal class in the order $\mathbb{Z}[\sqrt{-n}]$ of conductor $2$ in $\mathcal{O_{\mathbb{Q}(\sqrt{-n})}}$, but since in both cases the class number $h\left(\mathbb{Z}[\sqrt{-n}]\right)=1$, we have that $\frac{1}{2}q_1$ and $\frac{1}{2}q_2$ are equivalent and therefore $q_1$ and $q_2$ isometric.
These are actually the only cases in which we can use the "class number 1 trick", because none the other quadratic orders of class number 1 works. Could we do something similar for cubic fields?.
Edit: I made a mistake in the last update, even though the forms I mentioned do have discrimiant $-4 n$ not all of them are primitive which make the argument invalid.
In fact, for this forms is true that isometry implies the unit is a squre (It's enough to note that the form asociated to the fundamental unit it's not equivalent to $2(x^2+n y^2)$ ). So, the matter is still open even for quadratic fields.
Update 2: I'm going to try to focus in one case, give some examples, present some evidence and make the statement more elementary as @reuns suggest.
Let's focus in the quadratic field $\mathbb{Q}(\sqrt{n})$ with $n$ a positive square free integer $n \equiv 3 \,\text{mod} \, 4$, and its maximal order $\mathcal{O}=\mathbb{Z}[\sqrt{n}]$.
Acording to A031396 all of this fields will have totally positive fundamental units (because if $a^2-n b^2=-1$ is soluble and $n$ is odd then $ n\equiv 1 \,\text{mod} \, 4$). So let $u=a+b\sqrt{n}>1$ with $a^2-n b^2=1$ be the fundamental unit, the Gramm matrix of the form we asociate to $u$ and to $1$ in the basis $\{1 , \sqrt{n} \}$ are repectively
$\left[\begin{array}{cc}\text{tr}(u ) & \text{tr}(u\sqrt{n} ) \\\text{tr}(u \sqrt{n}) & \text{tr}(u\, n ) \end{array}\right]=2 \, \left[\begin{array}{cc}a & n b\\ n b & n a\end{array}\right] \,$ and $ \,\left[\begin{array}{cc}\text{tr}(1 ) & \text{tr}(\sqrt{n} ) \\\text{tr}(\sqrt{n}) & \text{tr}(\, n ) \end{array}\right]=2 \, \left[\begin{array}{cc}1 & 0\\ 0 & n \end{array}\right].$
now since, as noted in the begining, the forms associated to square units are isometric to the associated to $1$, there will be a nonsquare unit with form equivalent to $q_1$ iff this two forms are isometric (that's why I say it's enough to check for the fundamental unit).
When $a$ is even (for example for $n=3$ and $n=7$ with $u=2+\sqrt{3}$ and $u=8+3\sqrt{7}$ respectively), the forms are non even equivalent over $\mathbb{Z}_2$ ( because mod 4 one is $\left[\begin{array}{cc}0 & 2\\ 2 & 0 \end{array}\right]$ and the other $\left[\begin{array}{cc}2 & 0 \\ 0 & 2 \end{array}\right]$ ).
So the more interesting case would be when $a$ is odd (for example for $n=39$ with $u=25+4\sqrt{39}$), in this case both $\frac{1}{2}q_1=x^2+n y^2$ and $\frac{1}{2}q_2=a x^2+2 b n \, xy+ n a \, y^2$ are primitive forms of discriminant $-4n$. And the question could be rephrased as
Is it possible for $a x^2+2 b n \, xy+ n a \, y^2$ to be equivalent to $x^2+n y^2$?
Or in the language of ideals in $\mathbb{Z}[\sqrt{-n}]$
Is it possible for the ideal $\langle a, -b n+\sqrt{-n} \rangle_{\mathbb{Z}}$ to be principal?
I wrote the this code in Magma which shows that this is never the case at least for $n<20000$
> for l in [0 .. 5000] do
>n:=4*l+3;
> if IsSquarefree(n) then
> K := QuadraticField(4*n);
>v:=FundamentalUnit(K);
>a:=Abs(Trace(v)/2);
>b:=Abs(Trace(v*K.1)/(2*n));
> M1 := Matrix(2, [1,0,0,n]);
> M2 := Matrix(2, [a,n*b,n*b,n*a]);
>L1:=LatticeWithGram(M1);
>L2:=LatticeWithGram(M2);
> if IsIsometric(L1,L2) then
> n;
> break l;
> end if;
> end if;
> end for;
If I'm not mistaken, the answer is positive and it is much easier than you think.
Let $K$ be a totally real number field of degree $n$, for any totally positive integral element $x\in K$, we have $$\mathrm{tr}_{K/\mathbb{Q}}(x)\geqslant n\sqrt[n]{\mathrm{N}_{K/\mathbb{Q}}(x)}\geqslant n.$$ and $\mathrm{tr}_{K/\mathbb{Q}}(x)=n$ if and only if $x=1$.
For any order $\mathcal{O}$ in $K$ and a totally positive unit $u\in\mathcal{O}$, denote $q_1(x):=\mathrm{tr}_{K/\mathbb{Q}}(x^2)$ and $q_2(x):=\mathrm{tr}_{K/\mathbb{Q}}(ux^2)$. If $\phi:(\mathcal{O},q_1)\to(\mathcal{O},q_2)$ is an isometry, then $$\mathrm{tr}_{K/\mathbb{Q}}(u\phi(1)^2)=q_2(\phi(1))=q_1(1)=n$$ which implies $u\phi(1)^2=1$, so $u=\phi(1)^{-2}$ is a square.