LOS ANGELES (AP) _ Until last week, California state Sen. Gary Hart found that having a more famous namesake was a political plus.

The Santa Barbara Democrat, who often has been confused with the former U.S. senator who was running for president, got the best tables at restaurants and penthouse suites in hotels when reservations were made for ''Sen. Hart.''

The confusion contiuned as the Colorado politician's 1988 presidential campaign disintegrated last week over reports of purported extramarital relationships.

Joe Caves, state Sen. Hart's legislative assistant, said: ''There was some joking about the name, particularly when there are headlines alleging infidelity. 'What did your wife think about the headlines today?' Or, 'How did you explain that one to your wife?'''

A number of people confused over which Hart was which called one of the state senator's district offices. Every caller was supportive, urging the wrong man not to let the furor force him out of the presidential campaign.

''One man even called from Florida and said, 'I love your stands on issues. Hang in there,''' said Elaine Miller, the state senator's administrative assistant.

The California senator's reaction to the week's events was one of sadness, Caves said. The two Harts, whose political views and physical appearance bear some resemblance, are friends and mutual supporters. State Sen. Hart was an early backer of the other Hart's 1988 presidential bid.

Caves maintained the Colorado Gary Hart's stillborn presidential campaign is not a blow to the California Gary Hart's political aspirations.

''We never viewed it as a completely positive thing,'' Caves said.