ASKED by a journalist in April about Canada’s role in fighting Islamic State, Justin Trudeau, the prime minister, came back with a pithy lecture on quantum computing. “The uncertainty around quantum states,” he explained, lets quantum computers encode much more information than the conventional binary sort can. This detour into geekdom seemed natural at the Perimeter Institute for Theoretical Physics, which Mr Trudeau was visiting to proclaim his enthusiasm for basic research. The video of the impromptu lecture went viral, adding to the glamour already radiated by the snowboarding, cannabis-legalising, refugee-embracing prime minister. The assembled physicists duly cheered; Mr Trudeau then answered the question.

He has given boffins much to celebrate. Unlike his Conservative predecessor, Stephen Harper, who governed until last November, Mr Trudeau shows no inclination to muzzle politically inconvenient research. The Liberal government’s first budget, presented in March, increases federal spending on innovation clusters, university labs and research bodies, including the Perimeter Institute. In naming his cabinet Mr Trudeau rechristened the industry ministry: it is now the ministry of innovation, science and economic development.

All this has more to do with economic necessity than prime ministerial nerdiness. For a decade much of Canada’s growth has come from natural resources, especially oil and gas. That allowed Canada to ignore its weaknesses as a producer of knowledge-intensive goods and services. In the World Economic Forum’s ranking of countries’ performance in innovation, Canada comes a dispiriting 22nd. As a share of GDP it has the lowest level of “technology exchange”—money spent on or earned from patents, designs and other forms of know-how—among the 15 countries tracked by the Conference Board of Canada, a think-tank. “The resource supercycle covered up a lot of issues around innovation and productivity,” says Dan Muzyka, the Conference Board’s chief. The end of the commodity boom caused a six-month recession last year; in 2016 growth is expected to be a feeble 1%. Without more innovation, Canada is unlikely to grow much faster than that for long.

Canada does not lack scientists or good universities. Nor has its government been stingy. Public spending on research and development is higher as a share of GDP than in Europe and the United States (see chart). Where Canada falls short is in transforming ideas into marketable products. It produces relatively few patents. R&D spending by business has been declining for the past 15 years as a share of GDP; just 2.2% of companies are engaged in innovation, according to Dan Breznitz of the Innovation Policy Lab at the University of Toronto.

A report in 2013 on Canada’s innovation deficits by the Council of Canadian Academies, a think-tank, pointed out that the country’s managers have less education than executives in the United States and that government procurement policies do little to create markets for new technologies. Venture capital, the financial lifeblood of technology companies, is puny. Investment by Canadian venture-capital firms was C$2.6 billion ($1.9 billion) last year. That is 11% more than in 2014 but less than half as a share of GDP than in the United States. Canadian venture-capital funds also lack the expertise of their American counterparts, and so are less able to help companies grow. Stockmarket valuations for Canadian technology firms are lower than in the United States. As a result, most do not see a future for themselves as independent companies. Three out of four tech entrepreneurs surveyed by PwC, a consultancy, said they plan to sell their businesses within six years. That cautious strategy may owe something to an unambitious business culture, which is difficult to demonstrate but widely acknowledged. One Canadian techie who moved to California complains that “Canadians shoot for eighth place. They just want to make the playoffs.” The twin cities of Kitchener and Waterloo in Ontario embody both the strengths and weaknesses of Canadian innovation. The area’s most famous firm is BlackBerry, a maker of once-cool communications devices. Today it employs 3,000 people in the region, compared with 11,000 at its peak. When BlackBerry lost the smartphone war to Apple “everyone assumed that Waterloo was toast”, says Steve McCartney of Communitech, a non-profit group that helps tech companies. Yet the area seems to be thriving. Some 15,000 companies, at least a third of them startups, are based in the corridor that runs from Waterloo to Toronto. They employ 200,000 people. Mike Lazaridis, a co-founder of BlackBerry (and of the Perimeter Institute) is a University of Waterloo dropout. OpenText, one of Canada’s largest software companies, started as a university project to create an electronic database for the Oxford English Dictionary. Mr McCartney thinks Waterloo’s tech firms benefit from traditions of collaboration established by the area’s Mennonite groups.

Communitech, which seeks to encourage partnerships between technology companies and the university, is a prime example. It hosts “VeloCity Garage”, where 120 startups work on such products as a self-driving floor scrubber and a device that helps doctors find veins. Kik, a messaging app with 275m users, started there.

Yet Waterloo is more an exporter of talent than a magnet for it. The best business plans come from University of Waterloo students, says Paul Graham, co-founder of Y-Combinator, a venture-capital fund in California. A typical software engineer in Waterloo makes two-thirds the salary of his California equivalent (though the cost of living is also lower). Pay is “60-70% of the decision to move”, says Herman Law, a Waterloo graduate who works for a company that makes graphic-processing units for electronic games. Professional opportunities are also much greater in California. “The tech sector in Canada just isn’t as big,” Mr Law says. It ends up serving as the “farm team” for Silicon Valley, Canadians grumble.

Navdeep Bains, the innovation minister, says he knows what the problems are. His plan for solving them will be ready by early next year. It is likely to include measures to encourage more collaboration among business, government and academia. Some analysts think innovation incentives should depend less on tax credits, the main source of public support for R&D. Instead, the government should finance promising ventures. David Wolfe, of the Innovation Policy Lab, points out that Canada lacks a technology-development agency like the United States’ DARPA or Israel’s Office of the Chief Scientist. Insulated from political influence and pressure to produce quick results, such agencies can help commercialise technologies without spending much money, Mr Wolfe argues.

More self-confidence would also help, Mr Bains thinks. “We don’t brag enough,” he says. After Mr Trudeau’s elegant turn at the lecture podium that could begin to change.