When Indian Foreign Minister P.V. Narasimha Rao offered a toast at an official dinner in Tehran on Tuesday, he likened India and Iran to an "interwoven carpet of extraordinary beauty and many patterns" and rhapsodized about "fresher strands of song in our symphony."

Relations between the two nations appeared to be warming markedly. Rao and Iranian Foreign Minister Ali Akbar Velayati had agreed on a new joint economic commission to diversify trade relations and reduce dependence on superpowers, and Velayati said India was in an "outstanding position" to develop commerce within the Third World.

But the carpet now appears to have developed a wrinkle and the symphony a discordant note as a burgeoning new industry of Iranian tourism in India has run into a diplomatic obstacle.

The last group of Iranian tourists left India today before the imposition of an Indian government ban on group passports, the only kind of passport Iran's revolutionary government will issue for tourist travel.

The decision left in doubt the future of Iranian tourism to India and prompted an Iranian Embassy spokesman to complain sharply about a "political" act against his country.

Iranians began arriving again last May after Ayatollah Ruhollah Khomeini's government designated India as one of four countries to which Iranian tourists could travel, the others being Syria, Turkey and Pakistan. So far, groups have gone only to Syria and India, most of them coming here, according to an official of the Indian travel agency that arranged the trips.

Accompanied by an official of the Iranian Ministry of Islamic Guidance, the 1,800 tourists who have come here since May concentrated on places associated with Islamic history, with Agra and Delhi the most popular destinations.

Kashmir had been included in the itineraries, but was scratched by the Indian government because it was felt that the Iranians' presence in that predominantly Moslem state might inflame Hindu-Moslem tensions, according to the Indian Ministry of Tourism and Civil Aviation.

The Iranians, usually in groups of 140 to 200 a week, were allowed to travel here under collective passports, with 30 or more individuals registered on accordion-like pages of a single passport, which was held by a tour director.

Each tourist was allowed to bring $400 for expenses, but that, too, was deposited with the tour leader. Iranian tourists who were interviewed at one of the several five-star hotels in which they stayed said the collective passport was insisted upon as a security measure to prevent people from leaving the group on their own.

One of the Indian travel companies handling the tours, Sita Travels, was told to ensure that proper Islamic values were preserved on the trips, one tourist said. The groups ate only in dining rooms where no alcoholic beverages are served.

Ghulam Naqshband, managing director of Sita, said only that programs were presented that were "suitable for Iranian tourists from the point of view of Islamic culture." He said 40 percent of the tourists were married couples.

Naqshband denied reports that some Iranian tourists had dropped from sight during the trips, and he said they were not followed or watched closely by their tour directors.

In one hotel, the Maurya Sheraton, scores of Iranians crowded the lobby last week, many of them women shrouded in chadors--floor-length veils--and conspicuously keeping to themselves.

When asked about the new Indian ban on group passports, which is effective Saturday, a spokesman for the Iranian Embassy snapped over the telephone, "I can't answer that. It is a political question." Asked why it was political, he said, "When the government of India acts against Iran it is a political question, and I cannot answer."

A spokesman for the Indian Foreign Ministry said the ban on group passports was issued because "standard international practice is to require individual passports." When the Iranian government "had its own problems and could not give documents," the spokesman said, India agreed to make a temporary exception for Iranian tourists.