The broken glass has been swept from the steps at City Hall, the charred hulks of 12 police cars have been hauled away, and, for the moment, quiet has beeb welcomely restored to this picturesque city on the Pacific shore.

But today, even as San Francisco's political leaders speak hopefully of unity and an end to their long civic nightmare, this city remains badly strained and divided.

There is a growing sense among many here that the shocking assassinations of two of its top officials in November and the bloody rioting last Monday by its gay commmunity are only portents of turbulent outbursts to come.

"I see things brewing in the city," says Gayle Bates, a prominent local psychologist and political activist. "You've got a real polarization developing, and a lot of underlying unrest in the city."

Bates and others contend that San Francisco's famed social fabric of widely divergent cultural and ethnic communities has been strained to the breaking point by rising inflation, dwindling job opportunities and a severe housing crisis.

"We have real definite neighborhoods, racially and sexually, here, that are geographically right on top of one another," Bates said. "And there also exist two parallel communities overlaying that - one inviting experimentation, whether it's est or hippies or the Sexual Freedom League or gays, and the other a very traditional, family-oriented Catholic community. It's like two different words in one city.

"Economics is the thread that either makes things workable or makes them really up-tight," Bates said. "In an economic crisis, where people are competing for a dwindling number of jobs, that's when the pluralism becomes volatile."

The result, Bates and others contend, is a growing tension among the city's ethnic and cultural communities, each desperately trying to hold on to its portion of a dwindling economic pie.

Nowhere is the problem more pronounced than in the city's largest gay community, which has been shocked over the past six months by a sharp increase in anti-homosexual violence.

Gay leaders complain that there have been dozens of beatings, stabbings and shooting of homosexuals, primarily by Hispanic youths from the neighboring Mission Street area, since the beginning of the year.

They also say there is growing anti-gay sentiment in the city's black populace, and contend that their community has been the target of increased harassment by the predominately white police force, a problem that cultimated in last Monday's violent confrontation between homosexuals and the police.

"I think it gives the impression that the Golden Age in San Francisco is over," says Scott Anderson, news editor of The Advocate, the nation's largest circulation gay newspaper. "We've peaked, we're no longer going to get special consideration, the free ride is over."

It is precisely their recent ains in political power, the gays say, that have increased their visibility and therefore their threat to the rest of the city. Even more than the election of the city's first gay supervisor. Harvey Milk, two years ago, they point to slain mayor George Moscone, who gained office largely because of his support of the city's gay and other minority communities.

"You never before in San Francisco had a George Moscone representing the alliance of gays and minorities that he represented," says Art Agnost, a state assemblymen from San Francisco. "Now that those kinds of people have gained some power , it has created strains."

Much of that strain, Agnost says, is directed into attack not only on gays but also on the symbols of political power in San Francisco. He says that when he sponsored legislation, in the wake of November's slayings of Moscone and Milk, to upgrade benefits for the families of those murdered in office, "You wouldn't believe the letters I got saying assassination is a part of your job.'" Pointing to the relatively lenient verdict handed out to Dan White, he charges, "The jury basically said that Dan White killed a couple of politicians, and they're not so important."

While Agnost remains hopeful that the city will be able to weather the current storm, some point to other examples of growing tension in the city that indicate more troubles ahead.

Besides the conflicts between the gays and their neighboring communityes, there was an uproar recently in San Francisco's Jewish community over statements by a prominent local black leader attacking Israel's handling of the Palestinian problem.

The black community, in turn, has expressed its discomfort over the acquisition of several blocks of property in the Western Addition area by a group of Asian businessmen.

"All these different groups are at odds with each other in one way or another," says Frances Shaskin, a 30-year-veteran of San Francisco politics and currently a member of the Democratic Women's Forum. "It's broken out of the fragile shell that was holding it together. When Mayor [Dianne] Feinstein says let's put things back together, I just think it's not going to be put back together that easily."

Aggravation the increasing strains between the city's cultural communitues is a bitter division of opinion over the wisdom of continuing the city's posture as a mecca for America's alienated masses and the country's chief laboratory of social change. That image, some say, has produced a bizzarre cultural myth that breeds disorder and violence.

"It results in all kinds of people who wouldn't feel at home elsewhere gravitating to San Francisco," said Lester O'Shea, chairman of San Francisco's Republican County Central Committee. "It's an end-of-the-line phenomenon, and those that don't go off the Golden Gate Bridge stay here.

"In certain parts of the city, it's almost gotten to the point where you have to have a strong stomach just to drive through them, " O'Shea added.

"There's got to be some lines drawn somewhere in terms of public conduct. There has to be public order."

While in the past sentiments that were limited to the city's area conservative circles, the events of the past six months have led many of those who first were attracted to the city by its wide-open life-styles to wonder if there is not some serious flaw in San Francisco's grand social experiment.

"San Francisco has this glamorous image, that it wears its pathology on its sleeve," said a local psychiatrist who came here several years ago because of the city's promise of freedom and adventure. "And because the bizarre, sexually and socially, is not only permitted but to some extent encouraged here, one has to expect that more kinds of bizarre, violent eruptions are also going to occur."

The psychiatrist, who asked not to be indentified, does say in defense of the city that, "The rest of the country needs San Francisco to capture the imagery of that which is rejected elsewhere.

"But I'm actually considering leaving this place," he added, "because it's crazy." CAPTION: Picture, One demonstrator restrains another in front of San Francisco's City Hall as more than 5,000 faced police lines last week after the verdict in the Dan White trial. AP