In Star Trek, the Heisenberg compensator (or subspace field compensator) is a component of a starship's transporter system which was designed to sidestep one of the most basic laws of quantum physics – Heisenberg's uncertainty principle. The Heisenberg uncertainty principle states that when measuring conjugate quantities, which are pairs of observables of a single elementary particle, increasing the accuracy of the measurement of one quantity increases the uncertainty of the simultaneous measurement of the other quantity. The most familiar of these pairs is the position and momentum. Simply put, the uncertainty principle states that one cannot know both the position of a subatomic particle and its momentum to arbitrary precision - it is impossible to know both where an electron is and where it is going at the same time. 

Heisenberg's thought experiment for locating an
electron with an ideal microscope

Star Trek's transporter is supposed to operate by reading the precise quantum state of every particle making up the person to be transported, breaking down that person from their component matter into energy, "beaming" that energy to the desired location, and recombining this energy back into their component matter according to the information gleaned when the precise quantum state was read. However, the Heisenberg uncertainty principle states (in general terms) that one cannot know the quantum state of a subatomic particle to arbitrary precision. Heisenberg compensator therefore allowed the transporter sensors to compensate for their inability to determine both the position and momentum of the target particles to the same degree of accuracy and ensure the matter stream of an individual being 'beamed up' remained coherent during transport, and no data is lost.

The actual mechanics of how Heisenberg compensators were supposed to work has never been explained in any Star Trek episode or technical manual. When asked by Time Magazine in 1994, "How do the Heisenberg compensators work?" Star Trek designer Mike Okuda famously replied, "They work just fine, thank you."

In 2007, computer company Sun Microsystems actually launched the Sun Heisenberg Compensator at the Supercomputing 2007 (SC07) Conference in Reno, Nevada. This was, however, not an actual product but a video parodying the incomprehensible marketing techno-jargon used by computer companies in promoting their products.

The Sun Microsystems Heisenberg Compensator