Republicans talked optimistically of a bright political future here today as they concluded a weekend convention that was haunted by old quarrels and unresolved differences of the past.

In a festive atmosphere of ballons and poolside parties, the California Republican Party managed to bring Gerald R. Ford and Ronald Reagan to the same convention for the first time since the GOP met in Kansas City in the summer of 1976. It was an attempt by party leaders to demonstrate unity that served instead to advertise the ideological and personal differences that continue to plague the party.

The most emotional to turn over control of the Panama Canal to the Panamanians by the year 2000, which Ford supports and Reagan opposes. Sen. S. I. Hayakawa (R-Calif.) told reporters he was leaning 60 to 40 in favor of the treaties, a position which caused longtime Reagan aide Lyn Nofziger to quip. "Maybe we could give away one lock and keep two."

The feeling of the convention on the canal issue was expressed dramatically when delegates rose to their feet with a roar and applauded Sen. Paul Laxalt (R-Nev.), the Reagan national chairman in 1976 when he declared total opposition to the treaties. Some delegates yelled, "Tell Sam," a reference to Hayakawa.

However, state party leaders succeeded in persuading the most fervent opponents of the treaties to tone down a resolution of opposition. In its final form the resolution, was similar to one approved by the Republican National Committee last week that attacked President Carter's foreign policy and tried to sidestep implied criticism of Ford.

An earlier version approved by the resolutions committee here opposed the "dishonorable surrender" of the Panama Canal and called for the criminal trial of Sol Lonowitz, a chief U.S. negotiator of the pacts.

Well aware of the convention sentiment on the treaty issue, both Ford and Hayakawa were careful to confine their views to press conferences and not to mention the treaties in their speeches to the convention.

The canal issue, which Laxalt declared to be "the best issue handed a political party in recent times," diverted attention from state issues that California GOP leaders had hoped to develop in their attempt to regain legislative seats in 1978. Democrats now hold all but one statewide office and have a 57-23 majority in the California Assembly and a 26-14 majority in the Senate.

The principal Republican theme emerging in California is that Gov. Edmund G. (Gerry) Brown Jr. is a hypocritical politician who talks like a conservative but behaves like a liberal. In a speech, Reagan tried to link this theme to the Carter administration by inveighing against "the politics of piety and spiritualism now in vogue among Democrats from Sacramento to Washington."

Reagan also mocked Carter's prospective world trip, planned for Nov. 22 Dec. 2, as an attempt to recover prestige lost in his handling of the resignation of Bert Lance as his director of the Office of Management and Budget.

"There is an old presidential adage: When in trouble, travel," Reagan said. Reagan drew a crowd of 1,550 for his Saturday night speech, 200 more than the number of Republicans who heard Ford the night before. Reagan received at least twice the applause given the former President.

The principal entertainment of the convention was provided by John V. Briggs, a state senator who is trying to build himself into a gubernatorial candidate by describing the Democrats as "the party of grass, gays and godlessness." Briggs hopes to gain attention by supporting two initative neither of which has yet qualified for the California ballot. One would permit firing of homosexual teachers by local school boards and the other would broaden the list of crimes for which capital punishment could be invoked.

"We ought to put as many people as necessary in the gas chamber to restore respect for law and order," Briggs said. No one but Briggs gives him much chance for the nomination but he is playing an early role in identifying issues. Three-fourths of the questions asked of Attorney General Evelle J. Younger a press conference dealt with the Briggs-backed initiative on homosexual teachers.

Younger, the acknowledged leader in the GOP gubernatorial nomination race, maintains that existing law provides sufficient authority for acting against any teacher who molests a child or engages in a sexual display. Similar positions are taken by the three other prospective candidates - Los Angeles Police chief Ed Davis, San Diego Mayor Pete Wilson and Assemblyman Ken Maddey of Fresno.

Republicans concluded the three-day convention by passing a spate of resolutions which included opposition to the wiretapping and mail opening trail of former FBI agent John Kearney, criticism of efforts to apply the 160-acre federal water reclamation law limitation to the Imperial Valley and support of the "Hungarian Crown of Saint Stephen Protection Act." which seeks to prevent the United States from returning to Hungary the crown of St. Stephens the Martyr.