Relations between France and Spain, strained in the past by such issues as Basque terrorism and French opposition to Spain's application to enter the European Common Market, are poised for a significant improvement, according to officials in Madrid's month-old Socialist administration.

The Spanish optimism is due as much to the shared leftist ideology with President Francois Mitterrand's France as to the close personal ties among ministers of both countries. Growing trading links across the Pyrenees also have prompted Spaniards to take a fresh look at the longstanding animosity.

Hopes of a new climate were boosted by a two-day seminar in Paris this week attended by foreign and economic ministers of the two countries. The meeting was judged "positive and useful" by both sides, and further brainstorming sessions are planned at regular semiannual meetings.

Bilateral contacts in the past largely have consisted of bitter wrangles that served to increase mistrust among Spaniards of their powerful neighbor across the border.

France was accused of harboring Basque militants in southwestern France and of allowing them to plan terrorist actions with impunity. Repeated Spanish requests for extradition met with a firm refusal by Paris to waive France's traditional right of asylum.

On the European Community issue, France consistently has been the principal opponent to Spanish entry, arguing that early-season agricultural foodstuffs from Spain would cause incalculable harm to French farmers. When Spain first applied to Brussels six years ago, entry was set for this month. But it now has been postponed indefinitely.

The food-import problem spills into seasonal violence in the spring when Spanish truckers run a hazardous journey through southern France in the face of combative local farmers. Every season brings its toll of overturned trucks and rotting piles of agricultural produce.

The Paris seminar, held Monday and Tuesday, succeeded in keeping specific, vexing issues off the agenda. A Spanish official said it was "a high-pressured and yet relaxed" series of debates and working meals in which common problems were discussed.

The apparently fruitful dialogue reportedly was helped by a new approach from the Spanish team. Officials stressed that there is a longstanding friendship between the new Spanish foreign minister, Fernando Moran, and his French counterpart, Claude Cheysson.

A key member on the Spanish side was Economy Minister Miguel Boyer, who is a prominent Francophile, born in St. Jean-de-Luz in southwestern France and educated at the French Lycee in Madrid.

In contrast with previous Madrid administrations, which nurtured an often ill-disguised resentment toward France, the Socialists who took office in December, and in particular the Moran-Boyer tandem, appeared more flexible and sophisticated.

"They have a greater understanding of the way things are done in France and of French psychology," said a French diplomat in Madrid.

Prime Minister Felipe Gonzalez has, over the years, established a working relationship with Mitterrand through regular meetings of the Socialist International and is due to pay a private call on the French president Jan. 22 on Gonzalez's first trip abroad since taking office. He is traveling to Paris in a semiofficial capacity as the leader of the Spanish Socialist Party to attend a meeting of European Socialist premiers.

Numerous officials of Spain's youthful new administration have firm ties with France that were built during the Francoist dictatorship. France then acted as a magnet to political dissidents who traveled regularly across the border to see banned movies and buy books unobtainable in Spain.

Madrid officials who are hopeful of a new relationship cite close trade links between France and Spain despite the skirmishes over foodstuffs. France is Spain's biggest client and its third-biggest supplier.

The trade balance showed a healthy $32 million surplus for the first nine months of last year although the figure is deceptive because of considerable transnational investment--particularly French in Spain. French interests across the border are particularly well represented in the auto industry through Renault and Citroen-Peugeot.

Despite the optimism, the underlying problems that have plagued relations remain, in particular the present stalemate on the European Community issue and the continuing violence in the Basque region.

Moran appeared to bend toward the Paris view after the seminar by saying that the Basque problem was "essentially Spanish" and by saying, on the issue of the Common Market, that he would not "fall into the trap of naming entry dates."

What the Spanish foreign minister did claim was that a new understanding had been achieved and that this was a breakthrough. With Cheysson nodding assent, Moran told journalists, "It has never been said, as it is today, that what unites us is far greater than what divides us."