We present calculations of both the ground- and excited-state energies of spin defects in solids carried out on a quantum computer, using a hybrid classical-quantum protocol. We focus on the negatively charged nitrogen-vacancy center in diamond and on the double vacancy in 4H SiC, which are of interest for the realization of quantum technologies. We employ a recently developed first-principles quantum embedding theory to describe point defects embedded in a periodic crystal and to derive an effective Hamiltonian, which is then transformed to a qubit Hamiltonian by means of a parity transformation. We use the variational quantum eigensolver (VQE) and quantum subspace expansion methods to obtain the ground and excited states of spin qubits, respectively, and we propose a promising strategy for noise mitigation. We show that by combining zero-noise extrapolation techniques and constraints on electron occupation to overcome the unphysical-state problem of the VQE algorithm, one can obtain reasonably accurate results on near-term-noisy architectures for ground- and excited-state properties of spin defects.1 MoreReceived 7 December 2021Revised 27 January 2022Accepted 8 February 2022DOI:https://doi.org/10.1103/PRXQuantum.3.010339Published by the American Physical Society under the terms of the Creative Commons Attribution 4.0 International license. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI.Published by the American Physical SocietyPhysics Subject Headings (PhySH)Research AreasQuantum algorithmsQuantum computationQuantum simulationPhysical SystemsNitrogen vacancy centers in diamondQuantum InformationCondensed Matter, Materials & Applied Physics