Despite its stance of official neutrality in the Iranian-Iraqi war, the Soviet Union has taken steps to aid Iraq in the apparent hope of preserving a leading role here after the war and keeping intact the friendship treaty between the two countries.

While th Iraqis say they have not received "a single cartridge" from the Soviets since the war began in September," Western diplomatic sources here say Iraq has been receiving weapons from other Soviet Bloc countries and is obtaining valuable assistance from Moscow to help it repair quickly a war-damaged, Soviet-built power plant providing electricity for the capital.

It is highly unlikely that the Soviet Union's allies would be providing these arms, which include 100 tanks believed to have come from Poland, without Soviet approval, according to these sources.

Iraq, for its part, has just signaled its desire to continue the treaty, largely because it was able to obtain Soviet-made munitions in Eastern Europe and elsewhere, according to Tariq Aziz, a leading member of the ruling Revolutionary Command Council. Despite the Soviet refusal to provide arms directly, Aziz said in an interview that relations between the two nations were "normal."

Continuing access to Iraqi oil, particularly for its Eastern European allies, is believed to be a major reason for the Soviet decision to do something about its deteriorating relations with Baghdad.

Another is the Soviets' hope to avoid being shut out of Iraq altogether while trying to woo Iran and straddle the dispute between the two neighboring Persian Gulf powers with its stance of official neutrality. The Soviet attempt to carry out a similar policy with two warring neighbors in the Horn of Africa four years ago resulted in Moscow losing one old ally, Somalia, but gaining another in Ethiopia.

Analysts of Soviet policy here and in Washington believe Moscow decided late last year to repair its badly frayed relations with Baghdad after it failed to make much headway in establishing closer ties with the Iranian government headed by Ayatollah Ruhollah Khomeini.

Last month, Iraq and the Soviet Union celebrated the ninth anniversary of their treaty as if nothing had gone awry. An Iraqi delegation went to Moscow for the occasion, and Iraqi President Saddam Hussein and his Soviet counterpart, Leonid Brezhnev, exchanged messages expressing their desire to further their ties "based on mutual cooperation," the Iraqi News Agency reported.

"We are convinced that the treaty can serve well the basic interests of the people of the Soviet Union and Iraq in the struggle against imperialist intrigues and for a just and durable peace in the Middle East," Brezhnev's message reportedly said.

The same day, the joint Iraqi-Soviet committee for economic and technical cooperation held a four-day session to discuss what the Iraqi agency called the "horizons of cooperation" between the two countries in the area of oil and gas development.

The Polish tanks were sent to Iraq in January -- the main item known to have been shipped to Iraq thus far from any Eastern European nation -- although Saddam Hussein said he has signed contracts with both Eastern and Western Europeans for billions of dollars worth of new weapons since the onset of the war.

Since the signing of a commercial and transit accord with Iran in April 1980, analysts said they do not believe that Moscow has made much headway in improving its relations with the Khomeini government. The transit agreement created a "land bridge" helping Iran overcome the Western economic boycott imposed at Washington's behest to pressure Tehran to release the 52 Americans being held hostage at the time.

There has been an increase in Soviet exports to Iran as a result of the accord but "no payoff elsewhere," as one U.S. analyst put it.

Among the outstanding issues between the two countries has been the Soviet invasion of Afghanistan, which Tehran has vehemently opposed; Moscow's failure to condemn what the Iranians call the "flagrant Iraqi aggression against Iran," and the Iranian demand for renegotiation of the price of its natural gas being sold to the Soviets. The flow of Iranian gas to the Soviet Union was cut shortly after Khomeini took power.

In February, Iranian Prime Minister Mohammed Ali Raji told the Soviet ambassador to Tehran, Vladimir Vinogradov, that Iran saw no difference between the policies of the Soviet Union and the United States. Iraq, on the other hand, has made it clear that it does see a difference, still refusing to renew diplomatic ties with Washington 14 years after they were severed during the 1967 Arab-Israel war.

Although the Soviet Union has refused to provide Iraq directly with either arms, ammunition or spare parts since the outbreak of the war with Iran, it never totally stopped its military assistance to the Iraqi armed forces.