Solution (source code)

= Solution

Because $A$ is a <positive-definite matrix>, it has a positive-definite inverse square root. Choose the <exact inverse-square-root preconditioner>
$$
\boxed{P=A^{-1/2}}.
$$
Then
$$
PAP^T=A^{-1/2}AA^{-1/2}=I,
$$
which has one distinct eigenvalue, so preconditioned CG terminates in one step.

This construction is of little computational use because obtaining and applying $A^{-1/2}$ is generally at least as expensive in storage and arithmetic as directly factoring or solving the original system. A useful preconditioner must only approximate this transformation while remaining cheap to construct and apply.