DEALINGS between India and China are stunted in many ways. Rich cultural links once existed long ago, from the study of eclipses to Buddhist chanting, but hardly anyone remembers that today, laments Amartya Sen, a Nobel-prize-winning economist. After a love-in during the 1950s, China thumped India in a border war in 1962, and the two have continued to growl over their high-altitude frontier since. Indians envy Chinaâ€™s economic rise, but console themselves by pointing out that it is no democracy. Aside from stiff displays of fraternity at summits, most recently the G20 bash in Mexico on June 18th-19th, China seems not to think much about India at all. Investment flows are negligible. There are still no direct flights between Beijing or Shanghai and Mumbai, Indiaâ€™s commercial hub.

And yet a huge shift has taken place in the make-up of Indian trade. When India began to liberalise its economy in 1991, the West still dominated the world economy, and it was to the West that India turned for trade. Chinaâ€™s rise has now changed everythingâ€”for India, too. China is now its third-largest trading partner in goods, and the biggest if you include Hong Kong. For Chinaâ€™s East Asian neighbours a dominant trade with China is a given, but Indians are still trying to digest the development.

Rising trade with China has been good for India. It mainly imports Chinese capital goods, with firms benefiting from cheap and decent gear. The giant Reliance Group has bought kit for power stations and telecoms networksâ€”partly paid for with competitive Chinese loans. Chinese firms have often strived to win such business. Pan Song of Shanghai Electric, which makes power equipment for Reliance, among others, recounts years of hard slog in India.

But for India the China connection is also disconcerting. For every dollarâ€™s worth of exports to China, India imports three, leading to a trade deficit of up to $40 billion in the year to March 2012, or about 2% of GDP (see chart). China accounts for a fifth of Indiaâ€™s overall trade deficit with the world, over half if oil is excluded. Given Indiaâ€™s balance-of-payments woesâ€”the rupee has fallen by a fifth in the past yearâ€”even Chinese businessmen worry that the discrepancy in bilateral trade is unhealthy.

And it may grow larger. For a start, the little manufacturing India has tends to be quite high-end. As Chinese firms shift to more complex forms of production, they will make life harder for Indian firms. Saif Qureishi of Kryfs, which makes the metal cores of transformers used in, for example, power grids, says China has won a third of the Indian transformer market and is giving locals â€œa bloody noseâ€.

Meanwhile, India does not produce much that China wants to buy, a hole that British colonial rulers once plugged with exports of Indian opium. Today Indiaâ€™s main exports to China are less iniquitous raw materials, mainly minerals and cotton. But their continuing success is not a given. In the past two years the rivers flowing down to Goa on Indiaâ€™s west coast have teemed with barges carrying iron ore bound for China. Yet a crackdown in late 2011 on illegal mining has seen volumes fall by a fifth, says Atul Jadhav, of the Goa Barge Ownersâ€™ Association. In March India briefly banned cotton exports because of fears of shortages.

India is indeed prone to protectionist impulses. No bilateral free-trade agreement exists, and India often flirts with slapping duties on Chinese imports, most recently of power equipment. The Indian sales of Huawei, a telecoms firm, fell by half after it was hit with anti-dumping duties and labelled a security risk. Chinese firms complain of trouble with visas.

More hopefully, India wants to boost its exports to China. At the G20 summit it struck a deal to sell more rice. India would also like leading firms in industries including drugs, carmaking and IT to have better access to China. Most already have a presence, if only for procurement. Yet what is good for Indian multinationals may not generate jobs or foreign exchange for India. Tata Sons, with the biggest China operation, mainly sells Range Rover cars, made in Britain, and IT services, largely employing local Chinese staff.

And so the trade deficit looks likely to stay. Yet China could do more to help finance it, if given the chance. More loans from Chinese banks would be goodâ€”so far India has been wary, with only one Chinese bank allowed to have a branch there. More foreign direct investment would help, too. In 2011 Narendra Modi, the chief minister of Gujarat state, visited China to drum up investment. More often, India seems to regard FDI as the gift of Western multinationals alone.

It need not be so. In a dusty bit of Maharashtra state sits one of the first Chinese factories in India, run by Sany, which makes diggers and other construction machines. Richard Deng, its boss, says it has invested $70m and employs 460 locals; if all goes to plan it will double in size before long. T.C.A. Ranganathan, chairman of Exim Bank of India, reckons ten Chinese firms have or are building plants in India, and 100 firms have offices there.

Despite the usual cold sweats foreigners have about India (nightmarish red tape, a cultural gap), Chinese executives agree that more local production will take place. Sun Haiyan of Trina Solar, a solar-equipment firm, says that, as a global company, it has to manufacture locally. Wu Rong of ZTE, a telecoms concern, says it employs mainly locals and is producing more in India. Huawei, its India problems notwithstanding, is building a new research campus in Bangalore. Niu Qingbao, Chinaâ€™s consul in Mumbai, says Chinese firms are mustard-keen to invest in infrastructure, if also a little daunted.

Might this be the start of a wave of Chinese investment? India needs outside capital, and expertise in manufacturing and infrastructure. China must invest its surplus funds abroad, ideally not just in government bondsâ€”as mostly happens in Americaâ€”and ideally in countries that are not about to go belly up, as may happen in Europe. Chinese investment in India is an idea whose time has come, if only the two sides can conquer a legacy of mistrust.