OTTAWA, MAY 28 -- When Soviet President Mikhail Gorbachev steps off his plane here Tuesday for a 36-hour layover and meetings with Canadian Prime Minister Brian Mulroney, he may experience a moment of nostalgia as his troubles at home continue to mount.

It was here where the seeds of perestroika, or restructuring, were nurtured when Gorbachev, as a relatively obscure agriculture minister, visited Canada in 1983 and held long, private discussions with then-Soviet ambassador to Canada, Alexander Yakovlev.

Yakovlev, now one of the Kremlin's most powerful figures and Gorbachev's closest ally, was winding up a 10-year diplomatic posting here that had been, in effect, a political exile for past political transgressions.

A senior Sovietologist in Canada's foreign ministry recalled that Gorbachev and Yakovlev "had quite a bit of time together" as the up-and-coming Soviet agriculture chief visited farms and meat-packing plants in southwest Ontario and Alberta, rode the Maid of the Mist tour boat at Niagara Falls and held a 4 1/2-hour discussion with the prime minister of the day, Pierre Elliott Trudeau.

Yakovlev, widely viewed as a chief architect of the Soviet reform drive, had developed a keen understanding and appreciation of the West, and North America in particular, as a result of his wide-ranging travels during the era of East-West detente between 1973 and 1978, said the Canadian diplomat, who asked not to be identified.

"He admired many things we do in North America. If he is the author of glasnost, and I think he is, then I think that the North America experience rubbed off. He had to have had a sympathetic audience in Mikhail Gorbachev," the diplomat said.

After the Soviets announced their withdrawal from Afghanistan and Canada reciprocated by moving to restore suspended exchange programs, the diplomat said, Yakovlev was apparently stirred to action by the heated objections of Canadian scientists to the enforced isolation of physicist and human-rights campaigner Andrei Sakharov.

"Yakovlev was the man who recommended the return of Sakharov and his wife to Moscow. The Canadian scientists had turned him 180 degrees, and he realized the importance of human rights here," the diplomat said.

Yakovlev is not scheduled to accompany Gorbachev to Canada and Washington for his summit with President Bush, Canadian officials said, suggesting that the Soviet leader prefers Yakovlev remain in Moscow to handle political tensions at home resulting from retail pricing reform and independence movements in the Soviet Baltic republics.

Ministry officials said that Mulroney, who last November became the first Canadian prime minister in 18 years to travel to Moscow, will discuss a number of issues with Gorbachev, including German reunification and other European matters, international economic developments and the social and political changes in the Soviet Union.

The two are also expected to exchange views on a restructured North Atlantic Treaty Organization, of which Canada is a member. Ottawa would like to see NATO assume a wider political role, and Mulroney and External Affairs Minister Joe Clark reportedly are working on a new policy position on Europe.

Canada prides itself on being the only country that participates in NATO, the Group of Seven industrialized nations, the Commonwealth nations and the 30-nation organization of French-speaking countries. Its foreign-policy makers invariably stress that while Canada is decidedly North American, it is still part of the European establishment and does not represent a superpower threat to any country.

On Sunday, Clark said that the role of the 35-member Conference on Security and Cooperation in Europe should be expanded to include talks on conventional-arms reductions, and Canadian officials have said they believe that the CSCE is the best framework for Soviet participation in a new Europe. Gorbachev said in Moscow last week that the Soviet Union would review its policies on European arms control and security negotiations, including CSCE, if a reunited Germany were allowed to join NATO.

Officials here said that Mulroney and Gorbachev are also likely to talk about NATO's new generation of nuclear weapons and the continued testing of cruise missiles here.

The Arctic environment will also be discussed, officials said, particularly Canada's concerns over Soviet plans to renew nuclear-weapons testing in 1993 on the Arctic island of Novaya Zemlya, between the Barents and Kara seas. The Canadians have expressed fears that underground nuclear explosions may vent radioactive debris into the atmosphere.