A method for generating 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 comprising: preparing each of first and second qubits (13, 14) in a high-fidelity state generated with a set of Clifford gates; preparing N target qubits (15, 16) in the single qubit magic state, where N is an integer greater than one; performing a series of gates on the first qubit (13, 52), the second qubits (14, 53), and the N target qubits (15, 16, 54, 55), characterized in that a system (10, 50) comprising the first qubit (13, 52), the second qubits (14, 53), and the N target qubits (15, 16, 54, 55) is in a state 1 2 | 000 1... 0 N 〉 + 1 2 | 010 1... 0 N 〉 + 1 2 | 100 1... 0 N 〉 + 1 2 | 111 1... 1 N 〉, wherein the indexed values 1 through N represent the N target qubits (15, 16, 54, 55), wherein performing the series of gates comprises; performing a controlled NOT operation, controlled by the first qubit (13, 52), targeting each of the target qubits (15, 16, 54, 55); and performing a controlled NOT operation, controlled by the second qubit (14, 53), targeting each of the target qubits (15, 16, 54, 55); and performing a rotation of each target qubit (15, 16, 54, 55) around an axis of the Bloch sphere using at least one Clifford gate and at least one single qubit magic state, the rotation of each target qubit (15, 16, 54, 55) around an axis of the Bloch sphere comprises performing a rotation of each target qubit by positive or negative π/4 radians around a Y-axis of the Bloch sphere; performing a parity check on the N target qubits (15, 16, 54, 55) to provide a first measurement value; and accepting the first qubit (13, 52), the second qubit (14, 53), and a first target qubit (15, 54) as the Toffoli state if the first measurement values assume a desired value. preparing each of first and second qubits (13, 14) in a high-fidelity state generated with a set of Clifford gates; preparing N target qubits (15, 16) in the single qubit magic state, where N is an integer greater than one; performing a series of gates on the first qubit (13, 52), the second qubits (14, 53), and the N target qubits (15, 16, 54, 55), characterized in that a system (10, 50) comprising the first qubit (13, 52), the second qubits (14, 53), and the N target qubits (15, 16, 54, 55) is in a state 1 2 | 000 1... 0 N 〉 + 1 2 | 010 1... 0 N 〉 + 1 2 | 100 1... 0 N 〉 + 1 2 | 111 1... 1 N 〉, wherein the indexed values 1 through N represent the N target qubits (15, 16, 54, 55), wherein performing the series of gates comprises; performing a controlled NOT operation, controlled by the first qubit (13, 52), targeting each of the target qubits (15, 16, 54, 55); and performing a controlled NOT operation, controlled by the second qubit (14, 53), targeting each of the target qubits (15, 16, 54, 55); and performing a rotation of each target qubit (15, 16, 54, 55) around an axis of the Bloch sphere using at least one Clifford gate and at least one single qubit magic state, the rotation of each target qubit (15, 16, 54, 55) around an axis of the Bloch sphere comprises performing a rotation of each target qubit by positive or negative π/4 radians around a Y-axis of the Bloch sphere; performing a parity check on the N target qubits (15, 16, 54, 55) to provide a first measurement value; and accepting the first qubit (13, 52), the second qubit (14, 53), and a first target qubit (15, 54) as the Toffoli state if the first measurement values assume a desired value.