Barack Obama in UK: What can state visits achieve?
What is the point of a state visit?
A good state visit advances history in a positive way, a bad one rewards a bloody tyrant.
That would seem the obvious conclusion from two very different visits.
The one the Queen has just made to Ireland has been almost universally hailed as an immense contribution to the healing of deep historical wounds.
Much earlier in her reign - in June 1978 - the state visit to Britain by Romania's Communist dictator Nicolae Ceaucescu and his wife is seen as one of the least glorious.
Romania was already well-known as one of the most corrupt and oppressive of the Soviet Union's Cold War satellite states.
Eleven years after sleeping in a suite at Buckingham Palace, both Ceaucescus would be shot dead by their own people at the height of revolution in 1989.'Ultimate instrument'
Most state visits fit neither extreme. They often deepen relations, sometimes increase trade and investment, occasionally celebrate a historic alliance, or offer the prospect of a new one.
Alongside the pageantry, there's time for political dialogue between Britain's prime minister and the visiting leader. Increasingly, a whole troop of government ministers fly in too, and most of Whitehall gets involved.
Invitations to come to Britain for a state visit are really government invitations, of course, issued as the ultimate instrument of statecraft.
The endorsement they give to the heads of state who are invited is huge, hence the controversy when public opinion takes a dim view of particular state visitors.
Both Japan's emperors - Hirohito in 1971, and Akihito in 1998 - met very obvious hostility on London's streets from survivors of the brutality to British prisoners of war during World War II.
They gathered along the route of the traditional carriage procession to Buckingham Palace, some to turn their backs to the passing emperor, some to be even more demonstrative in their anger.
But others in Britain, including the governments who urged invitations to the emperors, thought the time had come to put reconciliation with Japan as a whole above complaints that full apologies and compensation were long overdue.
Zimbabwe's President Robert Mugabe was given a knighthood by the Queen during his state visit in 1994, before the worst excesses of his rule, only to be stripped of it 14 years later - on the same day that Nelson Mandela was received by the Queen at Buckingham Palace.
No-one questioned the former South African president's right to a state visit when he came in 1996, and that was universally regarded as a great opportunity to salute a truly global hero.No 101
Most state visits are either broadly welcomed, or leave the majority of people unmoved.
The Queen has been the host at 100 state visits to Britain across her reign.
The Obamas come in at number 101.
Their visit is a little out of the ordinary. They will be seen in public less than any visitors before them.
The standard ceremonial of a carriage procession up the Mall has been ditched - the palace say because time is simply too tight, but security fears must have played a part.
Otherwise, much remains the same.
Serious political discussion on day two. Pomp and plumage dominate the first day: bands, a guard of honour to be reviewed, and the ultimate evening: a state banquet in the palace at tables checked by the Queen before her guests arrive, with Scottish pipers circling the room at one point and speeches from the sovereign and the visiting head of state at another.
It seems all this never fails to impress, and there's little doubt the visitors - however powerful - feel they've been honoured in a special way.
Some leaders clearly deserve the honour. Some clearly do not.