Given a classical circuit of $m$ inputs and $n$ outputs, composed of various AND gates, OR gates, NOT gates, etc., a truth table is a $2^{m}\times(m+n)$-sized matrix, where, in general, the first $m$ columns encode the binary inputs while the last $n$ columns encode the binary outputs. When the circuit is reversible and consists of CNOT gates, CCNOT gates, CSWAP gates, etc., we have $m=n$ as the number of inputs is the same as the number of outputs.
However, certain square matrices can also encode the same information as a truth table. For example, for small enough $m$ Karnaugh maps can be used to study simplification of such circuits.
When the circuit is reversible, we can also construct a permutation matrix, which is a square matrix of size $2^m\times 2^m$, with a single $1$ in each row and each column. Such matrices are also unitary, which is a requirement for use in circuit-based quantum computing. Studying unitary matrices within quantum computing is more useful than studying other matrices such as truth tables, or other square matrices such as Karnaugh maps.
Given a truth table of a reversible circuit with, say, $5$ inputs and $5$ outputs of size $2^5\times 10$, how can we construct the corresponding permutation matrix of size $2^5\times 2^5$?
What is the general recipe or procedure for translating a truth table to the permutation/unitary matrix?
Community Wiki