Mars' core is 6-21% of the mass of the planet. Mars has a mass of 6 * 10^23kg. Heat capacity of iron is 450J/(kg * degree C). To heat up the iron by 1000 degrees C (rough estimate of what'd be required, though even if this is off by an order of magnitude, it won't change the conclusion), you'd need to provide at least:
1000 * .06 * 6E23kg * 450J/kg = 1.62 * 10E28 Joules. That's equivalent to 3.9 * 10^12 Megatons of TNT. In other words, it'd take about a trillion H-bombs to do what you say. Not feasible, clearly!!!
Luckily, that's not required. You can simply build a superconducting cable around the planet. The ambient temperature is already near the critical temperature of some of our highest performing superconductors, but because the cable (or, likely, a series of large cables in parallel to keep the local field at the surface of the superconductor below the critical field strength) will be large, insulating it very well should not be a problem, and the energy needed to run the cryocoolers could be provided by solar panels installed on top of the cable. (Superconductors also can carry more current if you keep them colder, so it's usually a good idea to operate well below the critical temperature anyway.)
This would be pretty easy to do, easier than the initial terraforming steps (i.e. raising the surface pressure by melting/subliming the ice caps and heating the regolith via albedo modification, super greenhouse gases, giant space mirrors, or Musk's favorite pulsed fusion over the poles). The amount of material required isn't that high, either. And the cable can also provide a planet-circling electrical grid and can provide vast amounts of seasonal storage capacity (actually, multi-decade storage capacity), thus negating the need for grid-level storage on Mars (or actually, the grid would literally be its own storage mechanism!).
But all this is kind of besides the point: planetary atmospheres tend to do the actual heavy lifting of radiation shielding. Earth's atmosphere is far more important than our magnetic field in lowering the radiation dose on the Earth's surface. And while in absence of a magnetic field the atmosphere is slowly stripped, that process takes hundreds of millions of years.