Looking every bit the queen her American cousins had been hoping to see, Britain's Elizabeth II put on her pearl-and-diamond tiara and matching jewels tonight to reign at a dinner given for her by President Reagan.

"I knew before we came that we had exported many of our traditions to the United States," the queen told a glittering black-tie crowd in a toast after dinner. "I had not realized before that weather was one of them."

With Prince Philip and Nancy Reagan looking on from a head table that included the British Foreign Secretary Francis Pym and Secretary of State George Shultz, the queen assured her hosts that her visit had been "spectacular and has fulfilled a long-standing ambition on my part to visit California and the West Coast. What better time than when the president is a Californian?"

Earlier, the queen got a rain check for a return visit after some of her California schedule was washed out this week.

"I've already told them I hope they'll come back," First Lady Nancy Reagan told her press secretary, Sheila Tate. "We'll give them a real rain check."

President Reagan, in his toast to the British monarch, reminded his guests that San Francisco had been the setting for the founding of the United Nations.

"Unhappily, subsequent events have continued to put our values and ideals to test," he said. "We have seen continued war, terrorism and human oppression in too many quarters of the globe.

"We are challenged to restrain and reduce the destructive power of nuclear weapons; yet we must maintain our strength in the face of the enormous military buildup of our adversaries."

The president and first lady welcomed the queen and Prince Philip to the handsome M.H. de Young Memorial Museum in Golden Gate Park shortly after 8 p.m., while three-quarters of a mile away 5,000 to 6,000 demonstrators were protesting everything from British rule in Northern Ireland and American involvement in El Salvador to unemployment, problems of the elderly and other social ills.

Although signs appeared bearing such slogans as, "Ireland for the Irish," and protesting the English presence in the Falkland Islands, the majority of the signs were aimed at President Reagan.

But earlier today, at a welcoming reception for the queen, Seamus Gibney, president of Irish Northern Aid, stood up to shout, "Stop the torture," just as actress and singer Mary Martin was about to entertain. "I was so excited when I came on stage and then that man was hollering and I lost all my nerve," said Martin tonight. "Then when they all stood up, my nerve came back."

Tonight, the Reagans and the royal couple posed for photographs, and only when the photographers finished did the queen finally smile. She wore a champagne-colored taffetta gown with ecru-and-gold sleeves trimmed with bows. It was a Hardy Amies design. Her tiara was one of 20 she reportedly owns.

Nancy Reagan wore an emerald green, silk satin crepe, with dolman sleeves and embroidered with crystal mirrors. The dress was by Galanos, and a crystal necklace by Tess Sholom added a glittering accent.

The dinner was in the Hearst Court but guests first assembled for cocktails in the Asian Art Museum at the de Young, where guests were asked not to smoke and those ordering wine had no choice but white, lest the carpet be damaged. In keeping with Washington practices, there was an exclusive VIP reception where Cabinet officers, senior White House aides and Senate Majority Leader Howard Baker were kept apart from the large, second-tier reception.

Prominent Californians were among the 260 guests, including Gov. George Deukmejian, Republican Sen. Pete Wilson and the queen's hosts earlier in the day on her outing to Silicon Valley, Stanford University President Donald Kennedy and the head of the Hewlett-Packard electronics firm, David Packard. On behalf of the president, Packard presented a computer to the queen when she visited his Cupertino operation. He said she could keep track of her race horses on it, and there were doubtless items involving her properties that could go into it.

"You explained those chips to them very well," Tobin Armstrong congratulated him. Packard smiled and said the royal couple was so intrigued by the computer demonstrated for them, "we had a hard time getting them away from it."

San Francisco Mayor Dianne Feinstein said she would not attempt to discuss the problems in Northern Ireland with the queen, contrary to what she told Irish supporters earlier . "I don't believe it's appropriate and I don't intend to do anything to violate protocol," she said.

In the Dining With the Queen Sweepstakes--other than the Reagans and their official party, who as hosts are ineligible to play--Walter and Lee Annenberg probably win. Their inclusion on tonight's guest list bring their grand total for the week to three dinners and one luncheon. Pete Wilson is a close runnerup. He attended the queen's shipboard dinner in San Diego, the 20th Century-Fox dinner in Hollywood and was the ranking member of the Senate here tonight, with Alan Cranston, the senior senator from California, nowhere to be seen.

Some of the others included John Chancellor, Alistair Cooke, Joe DiMaggio, Douglas Fairbanks Jr., David Frost, Ted Graber, Billy Graham, Ted Koppel, Willie Mays, Joe Montana, cartoonist Charles Schulz, and 49ers' coach Bill Walsh.

Regional politics were in evidence on the guest list with the inclusion of Robert Naylor, minority leader of the state Assembly. "I finally one-upped Willie Brown speaker of the Assembly . He's not allowing me to escort the queen tomorrow when she comes to the capitol," said Naylor.

In her toast at tonight's dinner, the queen declared that Britain is "deeply grateful for the unstinting contribution of the United States to the maintenance of the western alliance . . .

"From time to time friendships must be publicly reaffirmed. My visit has given me the opportunity to reaffirm the ideals which we share and the affection that exists between our people . . ."

The event was an Official Dinner rather than a State Dinner. The White House quoted the State Department's Office of Protocol as defining a State Dinner as one when affairs of state are being conducted between the United States and its visitors. "She is not here conducting the business of state," said Tate. "There are no talks being held in conjunction with her visit."

On Friday, the queen plans to reciprocate with a shipboard dinner honoring the Reagans on their 31st wedding anniversary.

"What more could you ask for on your 31st anniversary than to spend it with Queen Elizabeth aboard the royal yacht?" Mrs. Reagan told Tate.

She told her press secretary she slept "wonderfully" the one night--Tuesday--she was aboard the royal yacht Britannia at the invitation of the queen. She said she didn't hear any of the storm that raged around the yacht berthed in Long Beach Harbor. On Wednesday morning, Mrs. Reagan toured the yacht and had coffee with the crew. "It was so clean you could have eaten off the engine room's floor," she told Tate.

Today the queen was saluted at a spectacular performance in Davies Symphony Hall at San Francisco's Civic Center. Mayor Feinstein presided, but eight of the 11 San Francisco supervisors stayed away to protest the $2 million the visit is costing the city.

"You said you did not come to conquer territory," Feinstein told Elizabeth, a reference to the queen's speech in Los Angeles about how Sir Francis Drake had proclaimed California a possession of another Queen Elizabeth. "We're delighted you came to conquer hearts, and I think you will do just that." The salute featured a cast of thousands, from Mary Martin and Tony Bennett to the University of California Marching Band, the San Francisco Youth Symphony, a Chinese girls' drum and bell corps and the cast of "Beach Blanket Babylon."

Prince Philip kept time to one song by tapping his fingertips together, and when Bennett sang "I Left My Heart in San Francisco," Philip seemed to be mouthing the words. The queen's first lip-parting smile came when a performer wore onstage a huge hat that brimmed with British landmarks, including the Tower of London, Big Ben, Buckingham Palace and photographs of the royal family. Of that part of the program the prince told Steve Silver, producer of "Beach Blanket Babylon, "If that thing had fallen off, it would have been an international incident."

Before tonight's dinner, the queen's official taster checked out the five-course meal of lobster terrine with golden caviar, consomme of pheasant, quenelles of goose liver, loin of veal with morel and with balsam sauce and a dessert called Aurora Pacifica, created especially for the occasion by German-born chef Norbert Brandt, who is 29. The State Department is picking up the dinner tab, estimated by food experts at $70 a plate. Other production expenses are being underwritten by San Francisco firms and individuals, according to the White House. The guest list is more than two times the size of a comparable White House dinner.

Singers from the San Francisco Opera and members of the San Francisco Symphony, under the baton of Andrew Meltzer, entertained following dinner.

The following were invited to last night's official dinner given by President and Mrs. Reagan for Queen Elizabeth II and Prince Philip:

Francis Pym, British foreign secretary, and Mrs. Pym

Sir Oliver Wright, ambassador of Great Britain to the United States, and Lady Wright

The Duchess of Grafton, mistress of the robes

Lady Susan Hussey, lady-in-waiting

Sir Philip Moore

Robert Fellowes, assistant private secretary to Queen Elizabeth II

Michael Shea, press secretary to Queen Elizabeth II

Surgeon Captain Norman Blacklock, medical officer to Queen Elizabeth II

Sir Peter Ashmore, master of the household

Rear Adm. Paul Greening, flag officer royal yachts

Air Vice Marshal John Severne, captain of the queen's flight

Consul General and Mrs. John Beaven

Kurt Herbert Adler, general director emeritus, San Francisco Opera, and Nancy Adler

John David Alexander, American secretary, Rhodes Scholarship Trust, and Catherine Alexander

Walter H. Annenberg, former U.S. ambassador to Great Britain, and Leonore Annenberg, former chief of protocol

Samuel H. Armacost, president, Bank of America, and Mary Jane Armacost

Anne Armstrong, former U.S. ambassador to Great Britain, and Tobin Armstrong

Sen. Howard H. Baker Jr. (R-Tenn.) and Joy Baker.

James A. Baker III, chief of staff and assistant to the president, and Susan Baker.

Stephen D. Bechtel Jr., chairman, Bechtel Group Inc., and Mrs. Bechtel

Richard Beeston, London Daily Telegraph

Paul Berg, Stanford professor and Nobel Prize winner, and Mildred Berg

Benjamin F. Biaggini, chairman, Southern Pacific Co., and Anne Biaggini

Shirley Temple Black, former chief of protocol, and Charles Alden Black

Roger Boas, chief administrative officer, City and County of San Francisco, and Nancy Boas

Richard Burt, assistant secretary of state for European affairs

Philip Caldwell, chairman, Ford Motor Co., and Betsey Caldwell

W. Glenn Campbell and Rita Ricardo Campbell, Hoover Institution, Stanford University

John W. Chancellor, NBC News, and Barbara Chancellor

Sherman and Jean Chickering, San Francisco

Thomas W. Chinn, Chinese Cultural Society, and Daisy Chinn

William P. Clark, assistant to the president for national security affairs, and Joan Clark

Alistair and Jane Cooke

Amory and Phoebe Cooke, Woodside, Calif.

Sheldon and Betty Cooper, San Francisco

Malcolm and Martha Cravens, San Francisco

Vincent and Elizabeth Cullinan, San Francisco

Rene Yvon d'Argence, director and chief curator, Asian Art Museum of San Francisco and the Avery Brundage Collection, and Mrs. d'Argence

Louise Davies, Woodside, Calif.

Michael K. Deaver, deputy chief of staff and assistant to the president, and Carolyn Deaver

George Deukmejian, governor of California, and Gloria Deukmejian

Joe DiMaggio

Douglas Fairbanks Jr. and Mary Lee Fairbanks

Dianne Feinstein, mayor of San Francisco, and Richard Blum

Alan C. Furth, president, Southern Pacific Co., and Mrs. Furth

R. Gwin and Ann Follis, San Francisco

Charles Arleigh Foster Jr., Foundation for Teaching Economics, and Hannah Foster

Milton Friedman, professor and Nobel Prize winner, and Rose Friedman

David Frost

Russel Gallaway Jr. and Mrs. Gallaway, Sacramento

John and Henrietta Geer, Sacramento

Gordon Getty, director, Getty Oil, and Ann Getty

Richard N. Goldman, former president, Jewish Community Federation, and Rhoda Goldman

Charles and Margaret Gould, Hillsborough

Ted Graber

The Rev. Billy Graham and Ruth Graham

Walter A. Haas Jr., chairman, executive committee, Levi Strauss and Co., and Evelyn Haas

Prentis Cobb Hale, chairman, executive committee, American Retail Federation, and Denise Hale

Richard and Charlotte Ham, San Francisco

Mrs. Homer Hargrave and Paul Maginot, Templeton, Calif.

Ralph Harris, Reuters, and Ena Harris

Jessica Hart, trustee, H.M. de Young Memorial Museum

James D. Hart, chairman, Pacific Regional Marshall Scholarship Committee, and director, Bancroft Library, University of California, and daughter Carol Field

James R. Harvey, president, Transamerica Corp., and Charlene Harvey

Catherine Campbell Hearst, Beverly Hills

Randolph A. Hearst, chairman, Hearst Corp., and Maria Hearst

Alander and Maria Hogland, San Francisco

Jaquelin Hume, president, Ampco Foods Inc., and Betty Hume

George F. Jewett Jr., vice chairman, Potlatch Corp., and Lucille Jewett

Steven P. Jobs, chairman, Apple Computer Inc.

Natalia Makarova and Edward Karkar

Raymond Kassar, president Atari Inc.

George M. Keller, chairman, Standard Oil Co. of California, and Adelaide Keller

Donald Kennedy, president, Stanford University, and Barbara Kennedy

Robert Kerr, Santa Rosa

Leonard Kingsley, chairman, San Francisco Fine Arts Museums, and Sue Kingsley

Gorham and Diana Knowles, San Francisco

Ted Koppel, ABC News, and Grace Anne Koppel

Woodward Kingman, executive vice president, Crocker National Bank

Laurence William Lane Jr., publisher, Lane Publishing Co., and Donna Jean Lane

Edison Lewis, San Francisco

The Rev. John Joseph Loschiavo, president, University of San Francisco

John J. Louis Jr., U.S. ambassador to Great Britain, and Josephine Louis

George and Marcia Lucas

Henry Lucas Jr., chairman, New Coalition for Economic and Social Change, and Cerella Lucas

Robert A. Lurie, owner, San Francisco Giants, and Connie Lurie

Milton Marks, California state senator, and Mrs. Marks

Richard Madden, chairman, Potlatch Corp., and Joan Madden

Cyril Magnin, chief of protocol emeritus, City and County of San Francisco

Peter A. Magowan, chairman, Safeway Stores Inc., and Jill Magowan

Cornell C. Maier, chairman, Kaiser Aluminum and Chemical Corp.

Charlotte Mailliard, deputy chief of protocol, City and County of San Francisco

Francis A. Martin Jr. and Nini Martin, Hillsborough

Mary Martin and grandson Preston Hagman

Willie and Mae Mays

Peter and Alletta McBean, Hillsborough

John McCone, former director, Central Intelligence Agency, and Theiline McCone

Terence A. McEwen, general director, San Francisco Opera

Trudy McDonald, Republican National Committeewoman for California

Peter McKay, The Daily Mail

James and Anne McWilliams, San Francisco

Edwin Meese III, counselor to the president, and Ursula Meese

Richard K. Miller, president, San Francisco Opera, and Ann Miller

Joe Montana, San Francisco 49ers, and Cass Montana

Joseph A. Moore Jr., Moore Dry Dock Co., and Mrs. Moore

Gloria Morgan

Robert and Kay Naylor, Menlo Park

Wendy Nelder, president, San Francisco Board of Supervisors

Enid Nemy, The New York Times, and S. Ralph Cohen

John Osman, BBC

David Packard, chairman, Hewlett-Packard Co., and Lucile Packard

Sir Yue-Kong Pao, World-Wide Shipping Group, Hong Kong

John Place, chairman, Crocker National Corp., and Catherine Place

David Pleydell-Bouverie, Glen Ellen, Calif., cousin of Queen Elizabeth II

The Most Rev. John R. Quinn, archbishop of San Francisco

Donald Regan, secretary of the Treasury, and Ann Regan

Carl E. Reichardt, president, Wells Fargo Bank, and Patricia Reichardt

Dr. William Y. Rial, president, American Medical Association, and Constance Rial

Frank K. Richardson, associate justice of the California Supreme Court, and Mrs. Richardson

Paul F. Romberg, president, San Francisco State University, and Mrs. Romberg

Selwa Roosevelt, chief of protocol, and Archibald B. Roosevelt Jr.

Charles and Jean Schulz

William A. Seavey, president, English Speaking Union, San Francisco branch, and Mrs. Seavey

John and Kathy Seigle, Foster City, Calif.

J. Gary Shansby, chief executive officer, Shaklee Corp., and Barbara Shansby

George Shultz, secretary of state, and Helena Shultz

Steve Silver, producer

Mrs. William L. Stewart III and John C. Peters, Corte Madera, Calif.

John Suchet, Independent Television News

Walter H. Sullivan Jr. and Dagmar Sullivan, San Francisco

Edwin W. Thomas Jr., regional administrator, GSA, and Gretchen Thomas

Henry and Madelyne Trione, Santa Rosa

Bill Walsh, coach, San Francisco 49ers, and Geri Walsh

Dean A. Watkins, chairman, Watkins-Johnson Co. Inc., and Bessie Watkins

Caspar Weinberger, secretary of defense, and Jane Weinberger

Ian McKibbin White, director, de Young Memorial Museum, and Florence White

Brayton Wilbur Jr., president, San Francisco Symphony, and Judith Wilbur, president, Asian Art Museum

Lionel J. Wilson, mayor of Oakland, and Dorothy Wilson

Sen. Pete Wilson (R-Calif.)

Rep. Ed Zschau (R-Calif.) and Jo Zschau