  In this study, we employed a quantum computer to solve a low-energy effective
Hamiltonian for spin defects in diamond (so-called NV centre) and wurtzite-type
aluminium nitride, which are anticipated to be qubits. The probabilistic
imaginary-time evolution (PITE) method, designed for use in a fault-tolerant
quantum computer (FTQC) era, was employed to calculate the ground and excited
states of the spin singlet state, as represented by the effective Hamiltonian.
It is difficult to compute the spin singlet state correctly using density
functional theory (DFT), which should be described by multiple Slater
determinants. To mitigate the effects of quantum errors inherent in current
quantum computers, we implemented a $[[ n+2,n,2 ]]$ quantum error detection
(QED) code called the Iceberg code. Despite the inevitable destruction of the
encoded state resulting from the measurement of the ancilla qubit at each PITE
step, we were able to successfully re-encode and recover the logical success
state. In the implementation of the PITE, it was observed that the effective
Hamiltonian comprises large components of the diagonal part and a relatively
small non-diagonal part, which is frequently the case with quantum chemistry
calculations. An efficient implementation of Hamiltonian simulations, in which
the diagonal components dominate, was developed on a quantum computer based on
the second-order Trotter-Suzuki decomposition. This is the first instance of an
encoded PITE circuit being executed on a trapped-ion quantum computer. Our
results demonstrate that QED effectively reduces quantum errors and that we
successfully obtained both the ground and excited states of the spin singlet
state. Our demonstration clearly manifests that Zr$_{\rm Al}$V$_{\rm N}$,
Ti$_{\rm Al}$V$_{\rm N}$, and Hf$_{\rm Al}$V$_{\rm N}$ defects have a high
potential as spin qubits for quantum sensors.
