In music theory, a theoretical key is a key whose key signature would have at least one double-flat () or double-sharp ().
Some musical keys are not normally used because they would require a double sharp or double flat in the key signature. For example, G major requires eight sharps, and, since there are only seven scale tones, one tone requires a double sharp. The enharmonically equivalent key of A only requires four flats, making it clearer to read.
Enharmonic equivalence
The key of G major is a theoretical key because its key signature has an F, giving it eight sharps. An equal-tempered scale in G major contains the same pitches as the A major scale. These two keys are said to be enharmonically equivalent, and sound the same. Consequently, this key is almost always notated as A.
Even when music is written in a theoretical key such as G major, it can be notated either without a key signature or with a key signature containing single sharps, notating the Fs as accidentals.
Modulation
While a piece of Western music generally has a home key, a passage within it may modulate to another key, which is usually closely related to the home key (in the Baroque and early Classical eras), that is, close to the original around the circle of fifths. When the key is near the top of the circle (a key signature of zero or few accidentals), the notation of both keys is straightforward. But if the home key is near the bottom of the circle (a key signature of many accidentals), and particularly if the new key is on the opposite side (in the late Classical and Romantic eras), it becomes necessary to consider enharmonic equivalence (if double accidentals are to be avoided).
In each of the bottom three places on the circle of fifths the two enharmonic equivalents can be notated entirely with single accidentals and so are not theoretical keys:
The need to consider theoretical keys
When a parallel key ascends the opposite side of the circle from its home key, then theory suggests that double-sharps and double-flats would have to be incorporated into the notated key signature. The following keys (six of which are the parallel major/minor keys of those above) would require up to seven double-sharps or double-flats:
For example, pieces in the major mode commonly modulate up a fifth to the dominant; for a key with sharps in the signature this leads to a key whose key signature has an additional sharp. A piece in C-sharp that performs this modulation would lead to the theoretical key of G-sharp major, requiring eight sharps, meaning an F in place of the F already present. To write that passage with a new key signature would require recasting the new section using the enharmonically equivalent key signature of A-flat major. An example of such recasting is Claude Debussy's Suite bergamasque: in the third movement "Clair de lune" the key shifts for a few measures from D-flat major to D-flat minor (eight flats), but the passage is notated in C-sharp minor (four sharps) for ease of reading; the same happens in the final movement "Passepied", which reaches theoretical G-sharp major written as A-flat major.
Notation
Such passages may instead be notated with the use of double-sharp or double-flat accidentals, as in this example from Johann Sebastian Bach's Well-Tempered Clavier, which has this passage in G-sharp major, Bars 10-12.
In very few cases, theoretical keys are in fact used directly, putting the necessary double-accidentals in the key signature. The final pages of John Foulds' A World Requiem are written in G major (with F in the key signature), No. 18 of Anton Reicha's Practische Beispiele is written in B major, and the third movement of Victor Ewald's Brass Quintet Op. 8 is written in F major (with B in the key signature). Examples of theoretical key signatures are pictured below:
There does not appear to be a standard on how to notate theoretical key signatures: