By Nicholas Witchell
the BBC's Royal Correspondent
The Queen does not have any say over the choice of prime minister
The Queen is the only person who can invite someone to form a government and to become prime minister.
But that does not mean that the monarch can exercise any personal discretion over the choice of No 10's occupant.
After a general election, the Queen is obliged, by long-established convention, to invite the person who seems most likely to command the confidence of the House of Commons to become prime minister and to form a government.
If the outcome of that election is inconclusive, it is for the political parties to determine who that person is, and to communicate that choice to Buckingham Palace.
Only then will the Queen receive any outgoing prime minister to accept a resignation and, a short time later, to invite someone else to take the role.
The one thing that can be said with certainty amid all the uncertainty of a hung parliament is that Buckingham Palace is determined to maintain a distance from the political process and to keep the Queen well away from the discussions about who is in the strongest position to command the confidence of the Commons.
That is something for the politicians to sort out.
It is not for the Queen to decide who should be prime minister and, after nearly 60 years on the throne and eleven different prime ministers - from Winston Churchill to Gordon Brown - she is keenly aware of the potential pitfalls for a hereditary monarchy of being drawn into refereeing the outcome of an inconclusive election.
The Queen may be the font of authority, but it is not her role to determine who should receive her invitation to exercise that authority.
But what happens if the politicians simply cannot decide who has the strongest claim to become prime minister?
That is when we would enter difficult territory.
Not least because, in every other situation relating to the United Kingdom, the Queen would normally be guided by the advice of her prime minister, who is the monarch's principal adviser on all UK constitutional issues.
In the case of a hung parliament, the prime minister (who remains in office until such time as he tenders his resignation) is one of those vying for power.
He is an obviously interested party, whose advice can no longer necessarily be considered as neutral.
Consequently, this is one situation in which it is accepted that the monarch should take the advice of other knowledgeable figures.
Two Whitehall officials, the Cabinet Secretary Sir Gus O'Donnell, and the prime minister's principal private secretary Jeremy Heywood, will play important roles, liaising with the Queen's Private Secretary Christopher Geidt.
The Palace has also been consulting several leading academics who specialise in constitutional law. They have assisted the Palace in preparing for any eventuality, and they will be on hand over coming days to offer further advice if called upon.
The fervent wish within Buckingham Palace will be that the political leaders can determine amongst themselves who is in the best position to command the support of the House of Commons.
It may take some days, and the Palace will not seek unduly to hasten the process.
There are other, to some extent intangible, factors which should help the party leaders to come to an agreement amongst themselves.
They are all familiar with the principles upon which the British constitution rests. They are aware of the high importance of having a House of Commons which is independent from the Crown.
Equally, they will be aware of the high public regard for the way in which this particular monarch has carried out her public responsibilities from a time before virtually all of them were born. None of them, I suspect, would wish to place such a widely respected constitutional monarch in a difficult position.
The Queen will watch how things unfold. Her senior advisers will be in close contact with the cabinet secretary who, under the most recent Civil Service protocols, is permitted to assist the political parties to come to a decision about how to proceed.
Once they have done that, the motorcade(s) will make their way to the Palace and Elizabeth II will invite someone to form a government.