Until last fall, American diplomats working in a high-walled compound in one of this city's more prosperous districts were often made to feel unwanted. During the Vietnam War, the street outside the United States Consulate General was renamed for Ho Chi Minh. The gesture signaled the onset of 25 years of demonstrations and harassment that made the consulate one of the most beleaguered American diplomatic posts anywhere.

Then, suddenly, from one day to the next, the protests stopped. Where angry crowds once threw up makeshift platforms against the consulate walls for left-wing politicians to declaim against American imperialism, Calcutta businessmen now line up for visas that will give them a crack at the burgeoning trade between India and the United States.

The new mood reflects the wider changes in India, which has sought improved relations with the United States since New Delhi's alliance with the Soviet Union collapsed. Nowhere has the change reverberated more strongly than in Calcutta, the capital of West Bengal, which has been governed since 1978 by a breakaway faction of the Indian Communist Party, the Communist Party of India (Marxist).

While land reforms introduced by the Communists broke up feudal fiefs that had dominated the state of West Bengal for centuries and produced some of the most bountiful grain harvests anywhere in India, the poverty that has made Calcutta a byword for urban degradation has shown little sign of receding.

Now, for the first time in a generation, Calcuttans are beginning to hope that the city's long descent may finally be over. Since September 1994, the government here has formally thrown its weight behind the free-market economic reforms that were adopted by the national Government in New Delhi in 1991.

In place of helter-skelter nationalization, work stoppages that had driven thousands of businesses into bankruptcy, and a general climate of hostility toward outsiders, the Communists here have become arch-apostles for the new doctrines of free enterprise, foreign investment and a work culture that emphasizes productivity over strikes.

These days, visitors calling on Jyoti Basu, the 82-year-old Communist leader who heads the state government as Chief Minister, are likely to find him tinkering with his new desktop computer in the Writer's Building, the colonial edifice that served as the East India Company's headquarters when it ruled much of India in the 18th and 19th centuries.

Mr. Basu himself, immaculate in a homespun muslin dhoti, reminisces about his visit this summer to the United States, where he criss-crossed the country addressing Wall Street bankers and corporate executives from Boston to San Francisco.

Mr. Basu shakes his head vigorously when visitors suggest that the collapse of the Soviet Union helped bankrupt the ideology he has followed since the British authorities imprisoned him for his work as an underground Communist leader more than 50 years ago.

"A debacle has taken place in the Soviet Union, but we don't think it as the end of Marxism," he said.

Still, Mr. Basu speaks of his new policies in ways that make them hard to distinguish from those of the governing Congress Party leaders in New Delhi, who initiated the free-market economic reforms at the national level that have set off a rush for private investment, especially foreign investment, by India's 32 states and territories.

"If you are a Marxist or a Socialist, you must look at the realities of the situation, not what you imagine to be there," he said.

His conversion could have far-reaching implications, and not only for West Bengal, whose 70 million people remain close to the bottom of Asia's social and economic ladder. Although the economic reforms appear to have stalled at the national level, many Indians cite acceptance of the reforms in West Bengal -- a bastion of Indian Communism since the 1930's -- as proof that whatever the short-run political obstacles to free-market reforms, India ultimately has nowhere else to go.

Also, political pundits continue to suggest Mr. Basu as a possible prime minister after general elections expected in March or April. With the Congress Party undermined by allegations of high-level corruption and by divisions over the economic reforms, many commentators predict that the pro-reform wing of the Congress Party could be forced to seek a coalition with left-wing groups, including the the Communists, whose two main factions, including the Basu group, hold 50 of the 545 seats in Parliament.

So far, in Calcutta, the reforms' effects have been limited. Especially during the monsoons, the city presents a dispiriting spectacle of decaying buildings, vast slums where millions survive amid seas of mud and filth, sidewalks lined with the homeless sleeping on mats of sodden cardboard, stick-thin mothers with small children begging a few rupees for food.

Along traffic-clogged avenues in the city center, signs suggest that Mr. Basu and his colleagues have started not so much a revolution as a battle for the city's soul. Ho Chi Minh Street and others renamed by the Communists -- Lenin Street, Karl Marx Street -- testify to old loyalties, as do posters in the bazaars that urge Calcuttans to attend a pro-Cuba congress at which Mr. Basu denounced the United States "imperialism" against Fidel Castro.

But Socialist paraphernalia are dwarfed by billboard advertisements for mobile telephones and whisky and computer courses. And in a building close to the mansion from which Britain's governors general ruled India for 150 years, a close ally of Mr. Basu in the state's Communist hierarchy runs an investment promotion agency -- the West Bengal Industrial Development Corporation -- that many Westerners, including the United States Ambassador, Frank G. Wisner, regard as the best of its kind in India.

Anybody visiting Somnath Chatterjee, the agency's chairman, finds it harder to imagine India's retreating from the free-market reforms. Like Mr. Basu, Mr. Chatterjee can box like a champion on matters of ideology, arguing that the Soviet Union failed not because of repression and economic sclerosis but because, as he put it, "the entire world ganged up on Soviet Russia."

Mr. Chatterjee, 66, who has a second role heading the Communist bloc in the Parliament in New Delhi, greets visitors from behind a desk that would not look out of place in the Oval Office.

When asked how a Marxist adjusts to negotiating with executives from a roll-call of the world's blue-chip corporations -- Caltex, Matsushita, Motorola, Philips, Price Waterhouse, Rolls-Royce, Siemens -- that have signed tentative investment deals, Mr. Chatterjee smiled.

"I am a very practical person, like all Communists," he said. Perhaps with an eye to Communist Party stalwarts who have yet to reconcile to the changes, he added: "Inviting foreign capital is regretful. But from the viewpoint of the people's interests, there is no choice. I have no right to keep them poor."

Mr. Basu and Mr. Chatterjee -- indeed, just about anybody who discusses the matter in West Bengal -- acknowledges another motive. When Britain moved India's capital from Calcutta to New Delhi in 1912, and as late as the 1950's, when Bombay entered the era of rapid growth that has made it India's industrial and commercial powerhouse, Calcutta considered itself India's leading city. Today, after 20 years of shrinking production, it is a distant second to Bombay, but Mr. Basu is confident that "within a few years we will regain our old position."

But before the long climb back, the government will have to convince elements of its own constituency, particularly West Bengal's powerful labor unions, that free enterprise is the key to a better future.

Hundreds of other state-owned enterprises are bogged down by restrictive labor practises and red tape. Many have been technically bankrupt for years, unable to discipline or lay off workers; some, including factories with thousands of workers, have produced nothing at all in recent memory.

The Communist leaders also face an internal party struggle over the new policies. At the party headquarters here, posters of Stalin and Che Guevara adorn the walls. But despite talk of the "dictatorship of the proletariat" and "scientific socialism," there are signs that even the hard-liners have found ways to see old enemies in a new light.

"We are not inviting capitalism to West Bengal; we are inviting capital," said Anil Biswas, editor of the party's newspaper.

Reaching for a dog-eared copy of the Communist Manifesto, he turned to the section on capital and added triumphantly, "Read that, and you'll see that capitalism and capital are two entirely different things."

Photos: The free-market reforms embraced by the Communist Party leaders who govern the Indian state of West Bengal have created a battle over the political identity of Calcutta, the capital, where socialist symbols are being overtaken by commercial advertisements. (Dieter Ludwig/The New York Times) Map of India showing location of Calcutta.