The Reagan administration has decided to provide advanced military technology and weaponry to India in an effort to end a 20-year hiatus in large-scale U.S. military sales to the world's largest democracy.

The new policy, which is conditional on Indian acceptance of strict safeguards, became known as President Reagan and Indian Prime Minister Rajiv Gandhi held a "get- acquainted meeting" at the White House yesterday under very heavy security.

Defense officials said the administration decision to supply advanced military technology and weaponry goes beyond the agreement on the supply of civilian technology signed by the two nations last month. Currently, India obtains nearly all its imported weapons from the Soviet Union.

Reagan warmly welcomed the new Indian leader on the White House south lawn during distant but audible protests from about 1,500 members of the U.S. community of Sikhs, an important In- dian minority. Gandhi became prime minister when his mother, Indira, who ordered an Indian army assault on the Sikh's Golden Temple in Amritsar last June 6, was assassinated by Sikh bodyguards Oct. 31.

Gandhi and Indian Defense Minister Narasimha Rao are expected to discuss military technology at meetings Friday with Defense Secretary Caspar W. Weinberger and Gen. John W. Vessey Jr., chairman of the Joint Chiefs of Staff, according to the officials. U.S. officials said India expressed interest last month in obtaining sophisticated U.S. military technology for advanced surveillance and fighter aircraft, air defense and antisubmarine weapons and electronic warfare equipment, among other things.

The administration has decided in principle that it is willing to sell the Indians advanced technology and equipment, but has not yet passed judgment on any specific weapon or system.

The United States will insist on Indian acceptance of tight safeguards to prevent leakage of American defense secrets to the Soviet Union or other third parties, officials said.

Strict U.S. conditions on Indian use of U.S.-supplied nuclear fuel resulted in a breakdown of bilateral nuclear relations, and other U.S. conditions led to the failure of negotiations in the 1980s on the sale of U.S. missiles, howitzers and machine guns.

Large-scale U.S. arms sales to India ended at the outbreak of the India-Pakistan war of 1965. An intermittent U.S. embargo on such sales to India and inability to agree on terms when sales were permitted has curbed arms relations between the two countries.

In his talks with Reagan, Gandhi raised India's objections to the U.S. supplying of weapons to Pakistan under a six-year, $3.2 billion program. Reagan replied, according to a White House account, that the arms to Pakistan were intended to protect it against threats arising from Afghanistan and to let it assure its security without turning to nuclear weapons.

Gandhi told reporters later he was "not fully convinced." He said he had told Reagan "we would find it difficult to believe that all the equipment that is being given to Pakistan would be used on the Afghan border, especially if it is naval, is sea-skimming missiles and other equipment not suitable for hill areas."

Afghanistan is a landlocked and mountainous country. U.S. officials said surface-to-surface Harpoon missiles, the only major naval weapons being supplied to Pakistan, were justified by Pakistan's need to upgrade its navy along with other parts of its armed forces.

Afghanistan and Pakistan were among the topics discussed by Reagan and Gandhi in a 30-minute Oval Office meeting without advisers present, the White House said.

The Reagan administration is seeking to persuade Gandhi to intercede with the Soviet Union about its policies in Afghanistan. An attempt to do so by Indira Gandhi was rebuffed in Moscow several years ago, after which India became reluctant to do more, officials said. The attitude of her son is not entirely clear, the sources said.

The U.S. interest in a possible political settlement in Afghanistan is particularly high right now. Officials of the State Department and the Soviet Foreign Ministry are expected to hold talks on Afghanistan in Washington next week.

Pentagon officials said Indian interest in U.S. military technology results from prodding by the Indian military, which is pushing for a self-sufficient defense and views U.S. technology as the best form of assistance.

India's interest in U.S. military know-how has divided the Pentagon, with some officials viewing it as a chance to wean New Delhi from Moscow and others fearing that American defense secrets would slip to Moscow.

Undersecretary of Defense Fred C. Ikle visited New Delhi in May, giving momentum to the discussions. Ikle was handed a list of Indian requests for sophisticated technology and was taken to the nation's defense science center in Bangalore, where officials exhibited security precautions that included armed guards, fences and compartmentalization of sensitive materials, according to officials.

Weinberger decided after Ikle's return to Washington that the sensitive items sought by New Delhi could be considered on a case-by-case basis if the Indians signed an agreement to safeguard U.S. technology by adopting special security clearance procedures and maintaining physical security of defense installations, officials said.

Specific technology requests would have to be cleared by an interagency panel that includes representatives from the State Department and the National Security Council.