After two weeks of Olympic festivities, Moscow is gradually returning to normal. It is still -- until Sunday -- a closed city, and the absence of about 2 million Soviet visitors normally here at this time of year has accentuated the spaciousness of its boulevards and parks and the splendor of restored buildings and churches. It looks like an imperial city.

Of all the major capitals of the world, Moscow seems best prepared to produce a dazzling effect. It did so in 1969 for a world communist congress and again in 1972 when it received Richard Nixon for a formal inauguration of detente.

But the Soviets seem to have surpassed themselves in sprucing up the city for the Olympics. Miles of roads were repaved and suddenly lined with trees. Thousands of peeling buildings were painted. Stores were stocked with French perfumes and cognac, exotic foods and foreign fabrics -- without long lines to buy them. Everything listed on restaurant menus was available. There was even a shop selling ikons for hard currency.

But as athletes and guests began leaving early this week the ikon shop closed. The standard chicken dish was not available at the elite Hotel Rosiya restaurant, let alone several other dishes on the menu. French cognac was gone from the GUM department store.

"Welcome back to reality," a disappointed shopper in a line there said.

The reality of this country's chronic shortages is likely to become more evident next week, when Moscow opens its gates to the hordes of provincial visitors coming on shopping sprees.

Yet the organization of the 1980 Summer Olympics was too vast not to make a lasting impact on this capital.

In some ways, this is already clear. Thousands of Muscovites are scheduled to move into gleaming new apartments in the Olympic village. Tens of thousands have received special training in languages and services required to prepare the best Olympics that money could buy and they can now be expected to use these skills in daily life.

There are other Olympic byproducts. As a result of the U.S. boycott that led to cancellation of plans by NBC-TV to televise the Games, the Soviets bought large quantities of Japanese television equipment and trained hundreds of specialists to start a third national channel. City officials, wanting to show this ancient capital in its glory, have restored long-neglected and once-desecrated churches.

The hub of Moscow with the Kremlin and Red Square, had always been spectacular. Now, the magnificent 18th century Church of Metropolitan Philip, near the new stadium, and the Holy Trinity Church on the Ring Road, as well as a number of others, have added beauty and a sense of history to other parts of the city.

For some, the improvements only emphasize an enduring puzzle. This country has organized what many Western observers call an almost perfect, if joyless, Olympics. Yet it does not organize the economic life of its people as well as nations with far more limited resources.

The standard explanation is that the Soviets have already shown with their military establishment and with their achievements in outer space that they are capable of doing just about anything if they decide to commit the resources.

"The entire country lived for the Olympics for nearly two years," a Soviet journalist said. The Games involved the question of "our self-esteem," he added, conceding that the authoritarian rule here made such a mobilization possible.

It is impossible to calculate the price involved. Hundreds of thousands of workers put in millions of hours. Millions of rubles and dollars were invested in nonproductive projects at a time of economic hardship, including shortages of food.

The effort to impress the world with the power and accomplishments of the Soviet Union seemed to reflect a deep resentment on virtually all levels of Soviet society toward what is seen here as the West's attitude of superiority. The U.S.-led boycott only reinforced those feelings and stimulated efforts to turn the Games into a symbol of international recognition of the Soviet Union as a key actor on the world stage.

Another propaganda aspect of the spectacular jamboree was directed at the home audience.

The Soviets seem to have a particular respect for bigness and power and large-scale endeavors. Despite the boycott, the games provided visible evidence of official claims to Soviet preeminence in sports -- and in the ability to organize such a huge undertaking as the Olympics.

Apart from dissidents and some intellectuals, Soviets take evident pride in the unprecedented harvest of gold medals.

The Americans should have come, one hears people comment. Why didn't they come? Many Soviet citizens blame President Carter and his national security adviser, Zbigniew Brzezinski.

On the popular level, one does not find people who understand a connection between the Soviet invasion of Afghanistan and the boycott. This reflects official controls over information. The Soviet government used the boycott to tap wellsprings of patriotism.

There were some press reports here that the Americans not only were boycotting the Games but were also planning to disrupt them. This led to extraordinary security measures that turned Moscow into a garrison city.

Rumor had it that the CIA was doing something to create inclement weather for the Games. Nobody knew what that could be but it did rain until opening day, when the sun came out and remained for two weeks. It rained again the day after the Games closed.

"You see," said a cab driver, "God watches over Russia."