A quantum-computer-implemented system for providing at least three qubits in a Toffoli state having a first fidelity, from a plurality of single qubit magic states having a second fidelity such that using the single qubit magic states to construct a Toffoli state directly would result in a Toffoli state with fidelity less than the first fidelity, the quantum-computer-implemented system comprising: a first set of qubits, each storing a plus state; a second set of qubits, each storing one of the plurality of single qubit magic states; a third set of qubits, each storing one of the plurality of single qubit magic states; a plurality of controlled NOT (CNOT) gates each having one of the first set of qubits as a control qubit and one of the second set of qubits as a target of the CNOT gate; a plurality of rotation gates that each rotate a qubit of the second set of qubits around an axis of the Bloch sphere, each rotation gate comprising at least one Clifford gate and consuming at least one single qubit magic state stored in the third set of qubits; and a measurement assembly that measures at least one of the second set of qubits in a measurement basis perpendicular to the axis of the Bloch sphere around which each qubit of the second set of qubits was rotated, such that the first set of qubits and at least one unmeasured qubit of the second set of qubits provide the Toffoli state having the first fidelity, wherein each rotation gate is configured to perform one of a rotation of π 4 radians around the Y-axis and a rotation of negative π 4 radians around the Y-axis and comprises a controlled Y operation targeting the qubit of the second set of qubits that is controlled by a selected qubit of the third set of qubits and a measurement assembly that is configured to measure the qubit of the second set of qubits in the Y basis to provide one of a first value and a second value to perform a rotation of the qubit of the second set of qubits by π 2 radians around the Y-axis if the first value is measured, and to perform no rotation of the qubit of the second set of qubits if the second value is measured. a first set of qubits, each storing a plus state; a second set of qubits, each storing one of the plurality of single qubit magic states; a third set of qubits, each storing one of the plurality of single qubit magic states; a plurality of controlled NOT (CNOT) gates each having one of the first set of qubits as a control qubit and one of the second set of qubits as a target of the CNOT gate; a plurality of rotation gates that each rotate a qubit of the second set of qubits around an axis of the Bloch sphere, each rotation gate comprising at least one Clifford gate and consuming at least one single qubit magic state stored in the third set of qubits; and a measurement assembly that measures at least one of the second set of qubits in a measurement basis perpendicular to the axis of the Bloch sphere around which each qubit of the second set of qubits was rotated, such that the first set of qubits and at least one unmeasured qubit of the second set of qubits provide the Toffoli state having the first fidelity, wherein each rotation gate is configured to perform one of a rotation of π 4 radians around the Y-axis and a rotation of negative π 4 radians around the Y-axis and comprises a controlled Y operation targeting the qubit of the second set of qubits that is controlled by a selected qubit of the third set of qubits and a measurement assembly that is configured to measure the qubit of the second set of qubits in the Y basis to provide one of a first value and a second value to perform a rotation of the qubit of the second set of qubits by π 2 radians around the Y-axis if the first value is measured, and to perform no rotation of the qubit of the second set of qubits if the second value is measured.