In this paper, we present a new framework to construct a quantum circuit of S-boxes.We first model the quantum circuits of S-boxes based on the Toffoli and linear layers. We generate vector spaces with the values of qubits used in the linear layers and apply them to find quantum circuits.Our technique find the quantum circuit by matching the vector space's elements to the S-box's input and output, based on the meet-in-the-middle strategy.We applied our technique to 4-bit S-boxes.While existing LIGHTER-R tools only find 4-bit S-boxes circuits that can be implemented with 4 qubits, our tool accomplishes the same with 5 qubits.Our tool also finds reversible quantum circuits of 4-bit S-boxes, which are odd permutations that LIGHTER-R cannot.We expect our technique will become an important step towards finding optimized S-box quantum circuits.