WASHINGTON — What happens when you hold a summit without doing your homework, and after ignoring warnings from your own intelligence chiefs that Kim Jong Un would never give up his nuclear weapons?

Your summit falls apart, as President Donald Trump's did early Thursday morning. The outcome suggests that the biggest mistake made by the president and his top advisers was agreeing to the meeting with the North Korean leader in the first place.

After last year's meeting in Singapore, which at times appeared more like a buddy movie than a serious nuclear disarmament negotiation, Trump was widely criticized for saying "there is no longer a nuclear threat from North Korea."

He left it to Secretary of State Mike Pompeo to nail down Kim's vaguely worded promise to denuclearize. But the past eight months have been frustrating for the secretary of state: On one fruitless trip to Pyongyang last July, Pompeo was snubbed by Kim, who refused to see him; and shortly after Pompeo left Pyongyang, the North Korean foreign ministry excoriated him for what it called "gangster-like tactics."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

There are also plenty of signs that Trump has been relying excessively on his budding "bromance" with Kim, rather than the real hard slog of nuts-and-bolts arms negotiations by his team.

Last September, he told a rally in West Virginia that Kim "wrote me beautiful letters, and they're great letters. We fell in love." Visitors to the Oval Office say the president has shown off Kim's letters as testimony to his pride in the emerging relationship.

In fact, there were plenty of warnings that what some were calling the "pen-pal summit" was doomed before it got underway. As the administration's special representative for North Korea, Steve Biegun, told an audience at Stanford University on Jan. 31, "before the process of denuclearization can be final, we must also have a complete understanding of the full extent of the North Korean weapons of mass destruction missile programs."

But 10 days earlier, on Jan. 21, NBC News had reported that North Korea was expanding its weapons programs with as many as 20 undisclosed missile sites.

Biegun also said at Stanford that before the Hanoi summit, the administration expected to achieve "a set of concrete deliverables, a roadmap of negotiations, and declarations going forward, and a shared understanding of the desired outcomes of our joint efforts."

Judging from Trump's and Pompeo's comments before leaving Vietnam, none of that was achieved.

Still, on the eve of the summit the president was tweeting about the economic advantages of a deal and sparking comments by referring to the North Korean as "my friend." It didn’t take long for him to discover that the realities were a lot more complicated.

As the ranking Democrat on the Senate Foreign Relations Committee, Robert Menendez of New Jersey, told MSNBC, "the nuts and bolts of nuclear disarmament is a very difficult process; nuclear disarmament is far more difficult than the art of the deal. It's not about personal diplomacy or made for TV moments. I did not think the president should have gone to the summit without the preparation."

The analogy is not perfect, but the collapse of the Hanoi summit and the abrupt departure of the president reminded me of the 1986 summit in Reykjavik, Iceland, when Ronald Reagan and Mikhail Gorbachev — counting on their personal chemistry from their first meeting in Geneva — ran into the cold reality of their conflicting positions on nuclear weapons.

Their meeting collapsed in acrimony, but a year later they were signing the Intermediate-Range Nuclear Forces treaty in Washington. Perhaps it's a good omen that hard lessons can be learned from diplomatic failures.