Matrix (Doctor Who)
The Matrix, in the long-running British science fiction television series Doctor Who, is a massive computer system on the planet Gallifrey that acts as the repository of the combined knowledge of the Time Lords.

Background
The Matrix is first introduced in the 1976 serial The Deadly Assassin, twenty-three years before the release of the film The Matrix, six years before William Gibson's 1982 "Burning Chrome", eight years before Gibson's novel Neuromancer and years before the advent of virtual reality in the 1980s. It is one of the locations for a battle between the Doctor and Chancellor Goth, the titular assassin. Most of Part Three of the serial is spent inside the virtual reality of the Matrix where the Doctor battles an agent of the Master. The serial also explains that if a person dies while linked to the Matrix, he dies in the real world as well.

Access to the Matrix is obtained through an apparatus connected to or enclosing the head of the user or, physically, via Doors into which the user walks. The Matrix functions as a simulated reality, the physical laws of which an advanced user may bend or break.

Full access to the Matrix is given only to the President of the High Council of Time Lords through the use of the Crown of Rassilon, but limited access to its contents is guaranteed to other Time Lords. The Keeper of the Matrix holds the Key of Rassilon that grants access to the Seventh Door, which was thought legendary until the Doctor used the Key to access it in The Ultimate Foe.

The Matrix is part of the Amplified Pana tropic Computer Network, or APC Net, which contains the biological imprints (or bio-data extracts) of all Time Lords as well as the memories of dead Time Lords, storing them in an extradimensional framework of trillions of electrochemical cells. It also receives input from sensors contained in the TARDIS time machines piloted by Time Lords. As a result, the Matrix is not only a record of the past but can actually predict the future as well. The amount of knowledge in the Matrix, though vast, is not complete, and can be tampered with if given the right amount of access. The unauthorised extraction of a Time Lord's bio-data from the Matrix is an offence tantamount to treason (Arc of Infinity).

In The Trial of a Time Lord, evidence is gathered from the Matrix to present a case against the Doctor on charges of breaking the first law of time. This is done by the Valeyard, a learned Court Prosecutor. It transpires however, that the Valeyard has been able to tamper with the events shown by the Matrix to produce false evidence against the Doctor. When this is revealed by the Master, the Valeyard flees to a virtual reality world created by him within the Matrix. Within the Matrix, the Doctor is forced to fight the Valeyard, much like he had fought Goth in The Deadly Assassin. The Valeyard's world appears as a Victorian factory, and he is disguised as a Mr Popplewick. The Master is also able to materialise his TARDIS inside the virtual reality within the Matrix. Together the Master and the Doctor manage to defeat the Valeyard and discover his plan to murder the Time Lords at the trial with a Particle Disseminator.

In the revived series, though it seemed that they were destroyed, it was revealed that both Gallifrey and the Time Lords were removed from the known universe at the end of last great Time War. The fate of the Matrix was uncertain at the time as the Master returned to Gallifrey on its final day at the climax of "The End of Time". In "Dark Water", it is revealed that the Master, now in the form of Missy, created a Matrix called the Nethersphere to upload and edit the minds of recently dead humans before re-entering them into an upgraded Cyberman body.

The Matrix is a key element of the plot of "Hell Bent". When the Doctor returns to a resurrected Gallifrey, he extracts Clara from her timeline seconds before her death and the pair enter the cloisters of the Citadel where the Matrix is located, attempting to steal a TARDIS capsule from the workshop below. The Matrix is guarded by Cloister Wraiths and captured Daleks, Cybermen and Weeping Angels—the Doctor describes it to Clara as "a big computer, made of ghosts, in a crypt, guarded by more ghosts".

Other appearances
The following section contains information taken from spin-off material. The canonicity of these stories with regard to the television series and each other is open to interpretation.

In the Doctor Who comic strip published in Doctor Who Magazine, the Matrix is depicted as being inhabited by the minds of dead Time Lords—including Rassilon—who have a sort of quasi-existence within its confines. They are even able to construct an agent to do their bidding in the outside world, an entity known as Shayde.

The Past Doctor Adventures novel Matrix by Mike Tucker and Robert Perry reveals the existence of the "Dark Matrix", the negative thoughts and evil impulses of all the Time Lords whose knowledge is stored in the Matrix, syphoned off and forgotten. The Valeyard gains control of the Dark Matrix following the events of Trial of a Time Lord, and attempts to use it to manipulate the Doctor's timeline, feeding it with the negative psychic energy of the Jack the Ripper murders and using it to corrupt the Doctor's other selves to their basic, evil natures. Having escaped this fate by sealing his conscious mind in the TARDIS telepathic circuits, the Seventh Doctor destroys the Dark Matrix by imploding the Valeyard's TARDIS, thereby preventing an alternate 1963 in which its influence meant the Ripper murders never stopped.

In the Eighth Doctor Adventures novel The Ancestor Cell by Peter Anghelides and Stephen Cole, Gallifrey is destroyed by the Eighth Doctor to prevent the voodoo cult Faction Paradox from starting a time war between the Time Lords and an unspecified Enemy. In The Gallifrey Chronicles by Lance Parkin, it is revealed that the Time Lords had survived within the Matrix, which had then been downloaded into the Doctor's mind, although he had to sacrifice much of his memory to make space for it. Their reconstruction is possible, but will require a sufficiently advanced computer. At the novel's end, the question of whether or not the Time Lords will be restored remains unanswered. However, it can be assumed that both they and the planet are restored at some point before the start of the 2005 series if the novels are to remain consistent with the new series' continuity.

In the Big Finish Productions audio play Neverland, it is also established that Rassilon himself continues to exist within the Matrix. In the Gallifrey audio series, an ancient Gallifreyan evil named Pandora also survives and emerges from a special partition within the Matrix. Lord President Romana is eventually able to destroy the entity by destroying the Matrix itself. It is not clear how, or whether, the events of this series can be reconciled with those of the Eighth Doctor Adventures novels and some stories have suggested that the novels and audios take place in separate continuities.

Most of the 45th anniversary comic book series The Forgotten takes place inside the TARDIS Matrix, where the TARDIS takes the form of various companions to help the Doctor after he is attacked by a mind parasite. In the later stories "Hypothetical Gentlemen" &  "Sky Jacks", it is shown the matrix has developed sentience as a result of the death of every Time Lord on Gallifrey. The stories concern its attempts to return to reality via a machine at The Great Exhibition and the TARDIS.
Doctor Who devices
Fictional computers
Virtual reality in fiction