1. Mapping a target state to a generating circuit¶
In this tutorial, we use the TimeReversedSolver to map from a target quantum state, to a circuit which generates it. Similar to the last tutorial, we use a four-photon linear cluster state as our example state, and will measure the infidelity of the state generated by the discovered circuit. First we import all the relevant classes and dependencies.
Next, we pass the target, metric, and compiler objects to the solver and call the .solve() function which runs the main mapping algorithm.
We see that the circuit structure is identical to the example shown in the previous tutorial, and correctly generates the target cluster state!