The visit last week of Japan's new prime minister, Yasuhiro Nakasone, brought the U.S.-Japanese alliance to a new stage. The events of the past week were not a turning point in themselves but they could lead to one, for good or for ill.

The unusually bold, direct and outspoken Japanese political leader temporarily relieved much of the frustration and some of the pressure here on both the economic and military fronts. But Nakasone did this at the price of dramatically raising expectations which, if unmet, could generate even more serious trouble in the months ahead.

It is, as Nakasone declared, "a time of trial" for Washington-Tokyo ties. The immediate cause is the U.S. economic distress that has reduced the tolerance for disadvantages and burdens and has created a sense that the outside world, especially Japan, is being unfair.

Beneath the surface are deeper strains. Economic and military relationships in the world have changed greatly since the time when the United States was preeminent, but patterns of thought and action have not fully adjusted.

Japan is now second only to the United States as a free market industrial nation, with an economy about the size of West Germany and Britain combined. No longer a U.S. understudy, it is increasingly a competitor.

On the military side, though, Japan is still a lightly armed nation relying primarily on the postwar bargain that the United States provides security in return for military bases. Both the U.S. willingness and ability to perform that role is wearing thin.

The U.S. demands that confronted Nakasone are stunning evidence of how much the world has changed. The once-dominant Uncle Sam is insisting that Japan supply the United States with military technology, which previously flowed only the other way. Nakasone was asked to take measures to encourage the Japanese to buy more American cigarettes and to import more American beef and oranges. And Japan was asked to continue limiting its own auto shipments to America, so that its cars do not exceed their impressive one-fourth share of the U.S. market.

Nakasone had taken steps on the technology and cigarette issues in the seven weeks between his assumption of power and his arrival in Washington. He also promised a major effort to streamline testing and other import regulations considered barriers to U.S. goods. All this added to his credibility.

His credibility, on top of a clear commitment he has made to the relationship, sent hopes soaring at the White House and on Capitol Hill even though Nakasone announced no new economic commitments here. He seemed more knowledgeable, articulate and direct than his predecessors, "a guy we can work with," in the words of a U.S. policy maker.

In recognition of these hopes, President Reagan NEWS ANALYSIS invited Nasasone, his wife and daughter to an unscheduled breakfast meeting last Wednesday--a political plus for Nakasone, who already is exploiting the event as evidence of a personal relationship with Reagan. Reagan asked Nakasone to call him "Ron," Nakasone told the Japanese press, and said he in turn suggested the uncommon nickname of "Yasu."

It will not be easy for Nakasone to follow through on his early actions and commitments or to satisfy the remaining U.S. demands. Even if he does so completely, which is unlikely, results may be slow and elusive.

U.S. Trade Representative William E. Brock estimated Friday that the bilateral trade deficit will continue to rise in 1983 to about $22 billion. His "nightmare," Brock told reporters, "is what happens if the Japanese government does everything we asked them to do, and the thing doesn't change that much."

It is in the military field that Nakasone represents the greatest departure from the past. His Washington performance in official meetings as well as his much-discussed interview with Washington Post editors and reporters suggested that he is more nationalistic, more conscious of the need for a strong military and more outspokenly anti-Soviet than his recent predecessors. When reports of his statements reached the Japanese press, they touched off a political storm.

Until now, most of the public discussion here has been about Japan's 1 percent of GNP limit on military spending. Suddenly Nakasone is endorsing things that are of much more importance to U.S. strategists but that were rarely mentioned in public due to Japanese sensitivity. These include using the Japanese islands to wall off Soviet Backfire bombers and the Soviet Pacific fleet from easy access to the rest of Asia.

It clearly would require breaking the 1 percent limit to accomplish these things. It would also take a determination to play an international strategic role against Soviet military power in the Pacific. That would be a dramatic departure from postwar Japanese policy, as the Soviets were quick to see. They immediately issued a threat of nuclear retaliation if Japan undertakes such a role.

Though it is a big power economically, Japan does not think of itself in the same strategic league as the superpowers, China or the major European powers. Undertaking a serious strategic role would require--and bring--profound change.

How much Nakasone can accomplish remains a question. If he backs down or is brought down by the forces of Japanese politics and their strong inclination for gradualism, the expectations he sent soaring will come to earth here with a crash.

After the vivid Nakasone, the return to a self-effacing, seamless leadership style would go down hard in Washington. The aftermath could bring big trouble for a little-appreciated alliance that has been among the most stable, and one of the most important, of the postwar era