Suppose that the atomic bomb and the B-29 bomber were available a year earlier,in early summer 1944.
How much bombs on German cities are needed to obtain a
unconditional surrender of nazi German?
One. A strike to decapitate the Nazi state. Once Hitler is gone, the war is over. If the VALKYRIE bomb had succeeded on 20 July, that would have done it.
A nuke not only removes Hitler, it demonstrates the absolute military supremacy of the Allies.
There is the possibility that the Bomb doesn't kill Hitler; the Fuhrerbunker was deep and strong, and the Bomb could hit thousands of meters away. "Precision" bombing at this time was more of a joke than a reality, especially at night. The Bomb mission would probably go at night to evade German defenses.
That creates a different situation. Hitler will not surrender under any circumstances, but the German Army would. OTL, the Army was paralyzed by a number of factors, including the formal oath to Hitler all officers had sworn, and the possibility, however remote, that fighting on might get better terms from the Allies, who seemed bent on Germany's total destruction. The frog boiled slowly OTL.
While eventual defeat was obvious to many even in mid-1944, it was not
imminent. German forces were battling fiercely in France, Italy, the USSR - well outside Germany, and Germany still held vast conquests.
The Bomb changes the equation - it means that fighting on becomes useless
immediately. Hitler won't care. No Nazi will contradict him. But the Army has far more reason to overcome their scruples and act
now. Even some Nazis will balk at going down in total destruction.
But it may take a second or third Bomb.
A big question is whether the Bomb drops before or after the Schwarze Kapelle attempts VALKYRIE. OT1H, after VALKYRIE's failure the SK was exposed, broken, many liquidated. OTOH, the SK would be partially decapitated as well: several of the key plotters would be in Berlin near Ground Zero, at the HQ of the Replacement Army which they intended to use to seize control.
And after the German capitulation, with some German cities nuked, is possible that Japan surrenders without the need of launch the bomb?
Idunno. Rationally, Japan has no chance of averting defeat. But "rational" and "Imperial Japan" don't go together. The Japanese leaders may not even believe the reports from Europe - at least as far as the Bomb's effects.
The U.S. has just taken Saipan and Tinian; it would be a few weeks at least to base B-29s there. (Basing out of China is not an option; the Bomb is too sensitive to be deployed in such a chaotic area.) The great firebombing campaign hasn't even started, so there is a wealth of targets.
Possibly the first target would be Yokosuka Naval Base, near the mouth of Tokyo Bay. Its destruction would be a step to the elimination of the Japanese Navy, which at this time is still a serious threat. The effect would be highly visible to the leadership in Tokyo - not just the blast and flash, but they could go look at the site easily.
At this point would reason take over? Perhaps after three Bombs have wrecked much of the surviving Japanese Navy... OTL the hard-liners's final fantasy was that the U.S. forces would land in Japan and suffer heavy casualties from banzai attacks, and the U.S. would be shocked into making peace. ATL, the U.S. is not coming ashore any time soon, but is instead battering Japan into ruins with an utterly devastating weapon. It seems possible that in this context, resistance would be seen as futile by enough of the leadership to end the war.