  The conducting and mechanical properties of a metallic nanowire formed at the
junction between two macroscopic metallic electrodes are investigated. Both
two- and three-dimensional wires with a W(ide)-N(arrow)-W(ide) geometry are
modelled in the free-electron approximation with hard-wall boundary conditions.
Tunneling and quantum-size effects are treated exactly using the scattering
matrix formalism. Oscillations of order E_F/lambda_F in the tensile force are
found when the wire is stretched to the breaking point, which are synchronized
with quantized jumps in the conductance. The force and conductance are shown to
be essentially independent of the width of the wide sections (electrodes). The
exact results are compared with an adiabatic approximation; the later is found
to overestimate the effects of tunneling, but still gives qualitatively
reasonable results for nanowires of length L>>lambda_F, even for this abrupt
geometry. In addition to the force and conductance, the net charge of the
nanowire is calculated and the effects of screening are included within linear
response theory. Mesoscopic charge fluctuations of order e are predicted which
are strongly correlated with the mesoscopic force fluctuations. The local
density of states at the Fermi energy exhibits nontrivial behavior which is
correlated with fine structure in the force and conductance, showing the
importance of treating the whole wire as a mesoscopic system rather than
treating only the narrow part.
