How do computational programs decide how many virtual orbitals to compute?

How do computational programs decide how many virtual orbitals to compute? For example, a Gaussian job of benzene at the TD-DFT B3LYP/3-21G level of theory calculates from 42 electrons a total of 66 orbitals. Why not 65 or 67? Is there any significance to the number it to stop at?




The basis functions you use describe a space within which your orbitals are vectors. If you have $N$ basis functions this space is $N$-dimensional, and in a $N$-dimensional space you can have at most $N$ vectors which are linearly independent, thus you can have at most $N$ orbitals. In the above example, the 3-21G basis set you are using has 66 basis functions, 9 on each carbon and 2 on each hydrogen, and $(6 \cdot 9) + (6 \cdot 2) = 66$, so you can describe at most 66 orbitals.


 12