  Most quantum computing architectures can be realized as two-dimensional
lattices of qubits that interact with each other. We take transmon qubits and
transmission line resonators as promising candidates for qubits and couplers;
we use them as basic building elements of a quantum code. We then propose a
simple framework to determine the optimal experimental layout to realize
quantum codes. We show that this engineering optimization problem can be
reduced to the solution of standard binary linear programs. While solving such
programs is a NP-hard problem, we propose a way to find scalable optimal
architectures that require solving the linear program for a restricted number
of qubits and couplers. We apply our methods to two celebrated quantum codes,
namely the surface code and the Fibonacci code.
