A nanowire device includes a nanowire formed between two surfaces, and a gap formed at a predetermined location in the nanowire.