  In this article we continue our investigations of one particle quantum
scattering theory for Schroedinger operators on a set of connected (idealized
one-dimensional) wires forming a graph with an arbitrary number of open ends.
The Hamiltonian is given as minus the Laplace operator with suitable linear
boundary conditions at the vertices (the local Kirchhoff law). In ``Kirchhoff's
rule for quantum wires'' [J. Phys. A: Math. Gen. 32, 595 - 630 (1999)] we
provided an explicit algebraic expression for the resulting (on-shell) S-matrix
in terms of the boundary conditions and the lengths of the internal lines and
we also proved its unitarity. Here we address the inverse problem in the
simplest context with one vertex only but with an arbitrary number of open
ends. We provide an explicit formula for the boundary conditions in terms of
the S-matrix at a fixed, prescribed energy. We show that any unitary $n\times
n$ matrix may be realized as the S-matrix at a given energy by choosing
appropriate (unique) boundary conditions. This might possibly be used for the
design of elementary gates in quantum computing. As an illustration we
calculate the boundary conditions associated to the unitary operators of some
elementary gates for quantum computers and raise the issue whether in general
the unitary operators associated to quantum gates should rather be viewed as
scattering operators instead of time evolution operators for a given time
associated to a quantum mechanical Hamiltonian.
