AN EXERCISE in pure reason has turned into an elating work of architecture that also works magnificently as a great museum.

We have probably built more museums in this country in the last two decades than in the previous 200 years. Most show off their architecture, but are poor showcases for art.

Ieoh Ming Pei's East Building of the National Gallery of Art is an architectonic symphony of light and marble, color and glass, painting and sculpture. It is surely one of the most impressive statements of the art of our time.

During its seven years of construction, many of us had misgivings about the East Building.

What had seemed so dazzlingly clever in the cardboard model grew to seemingly monstrous proportions. Had we been blinded by architect Pei's brilliant geometry? He had taken the site's awkward shape - the trapezoid between the Mall, Constitution Avenue and 4th Street - sliced it into the logical components of the building, placed it on axis with John Russell Pope's Gallery temple, and let this exercise in reason determine the form of the new building.

An odd form.

In clear light, there were moments when the huge, stark, pink Tennessee marble sculpture looked threatening. It seemed abstract and alien, coldy unrelated to the familiar temples along the avenue and an insult to the pictureque majesty of the Capitol in the background.

Yet, in twilight or mist, with its smooth marble skin over a good, prominent bone structure, it turned into a beauty.

Now the East Building is substantially completed. The public will first find it "difficult." But once you enter, it will instantly and in every light reveal its full beauty. Once you have been inside, you will understand the exterior, too.

There are two ways to enter: From the old building, through a bustling underground concourse that includes a museum shop, a cheerful restaurant and a moving walkway. Or directly, from the cobblestone plaza that puts a respectable distance between the senior building and its self-confident junior.

Either entrance is a pleasant, but casual overture, just enough to convey a sense of anticipation. There is a low lobby, like a short pause, and you are in the central court - a crescendo of spaces. It is exhilarating. You are immersed in delight.

I.M. Pei's architectural hallelujah reminds me of the joyful, white and gold domed naves of Bavarian baroque churches, where swallows twitter and swoop through theatrical sunbeams. It is that evocative.

And this great court, with its frame space skylight, its playful triangles of light, its calmly moving Calder mobile, its galleries, ramps, stairs, trees, statuary and infinite drama, is nothing like baroque . . .or classic, or Modern, or anything else you might label it. The entire building is a unique conception. My guess is that in contrast to most modern buildings, Pei's East Building, like Verdi's operas will be instantly popular.

The East Building has two parts: Exhibition areas, which open June 1, and the Center for Advanced Study in the Visual Arts, which will open at a later date.

The exhibition spaces are composed of three towers connected by bridges, framing the central court. Both towers and bridges contain galleries, in addition to two auditoriums and several service areas. Unlike most modern museums, the exhibition areas are largely illuminated by daylight, not only from overhead but also through glass walls. The panoramic views these windows afford should reduce museum fatigue.

The Center is almost a separate building. It shares only the great court with the galleries. In plan, it is a triangle with a razor-shape edge that is fated to be photographed as one of the great dramatic views in the history of architecture. The Center has eight levels of offices, like open shelves, and six levels of library space that share another court. With the Capitol view through the glass walls, this set is likely to thrill filmmakers.

Art historians have written volumes about the integration of modern art and architecture. This has been achieved in Pei's great hall. The Calder, the Miro tapestry and the Tony Caro construction, among others (which I suspect will be permanent fixtures in the Great Court) were commissioned for the building and seem as much part of it as Bernini's pulpit is part of St. Peter's in Rome.

But the East Building galleries are not another museum of modern art. Their first show - the Kunstkammern of Dresden and a selection of Piranesi drawings - demonstrate this. Pei designed these galleries for complete flexibility; their drywall constructions can be changed at will to serve as suitable backdrops for displays.

Superb execution, as one architectural writer put it, is as important to a finished work of art as inspired design; and if Pei's Gallery represents anything, it represents superb execution. It is reassuring that for all its plastic and concrete shoddiness, our time can produce such craftsmanship. I believe the general contractor, Chas. H. Tompkins Co., deserves special credit.

Just look at the beauty of teh architectural concrete. Generally, concrete is an overrated, cheap-looking material. Consider the streaks and leaks in our otherwise handsome new Metro rail stations. In Pei's building, the concrete is an aggregate of pinkish marble dust poured into forms that are the result of meticulous cabinetwork, made with the care and mitering of parquet floors.

Look at the chromed rails of the escalators and staircases. And at how the escalator in the central court is slightly recessed in the marble wall (one of many examples of admirable stone carving) to show that is is not some mechanical gadget, plunked like a TV set in a Chippendale drawing room, but an integral part of the building.

One of the most impressive - and, to my knowledge, original - details is the way Pei made the building's mechanical services invisible. (In the dreadful Pompidou art center in Paris, the architects labored to make the mechanical pipes and ducts, painted in garish colors, the foremost architectural feature.) In the East Building, electric conduits are in the coffer form (the triangular relief in the ceiling). Airconditioning circulates through unobtrusive "scoops" beneath the skylight and is also blown in and out through equally unobtrusive openings in the risers of the stairs as well as in planters.

As one of Pei's engineers remarked, "You have to work hard to make things look simple."

This simplicity, as has been much noted with envy in architectural circles, cost $94.4 million. But if this building proves itself to be as great as I think it is, who will ask how much it cost in 50 or 100 or 500 years? What did the Louvre cost?