  We introduce a procedure to systematically search for a local unitary
transformation that maps a wavefunction with a non-trivial sign structure into
a positive-real form. The transformation is parametrized as a quantum circuit
compiled into a set of one and two qubit gates. We design a cost function that
maximizes the average sign of the output state and removes its complex phases.
The optimization of the gates is performed through automatic differentiation
algorithms, widely used in the machine learning community. We provide numerical
evidence for significant improvements in the average sign for a two-leg
triangular Heisenberg ladder with next-to-nearest neighbour and ring-exchange
interactions. This model exhibits phases where the sign structure can be
removed by simple local one-qubit unitaries, but also an exotic Bose-metal
phase whose sign structure induces "Bose surfaces" with a fermionic character
and a higher entanglement that requires deeper circuits.
