Theoretical key
For example, the key of G major is rarely used to write music down, because its key signature has an F. An equal-tempered scale of G major has exactly the same notes as the A major scale. Key pairs like this are called enharmonically equivalent. So the theoretical key of G major is usually written with the key signature of A major.