Semiconductor laser utilizing transitions between size-quantization levels with separate electron and optical confinement