# Examples¶

The examples folder contains various illustrations of QuantumFlow in action.

• state_prep_w4.py

Prepare a 4-qubit W state using sqrt(iswaps) and local gates.

• state_prep_w16.py

Prepare a 16-qubit W state using sqrt(iswaps) and local gates, respecting linear topology

• swaptest.py

Apply a Swap Test to measure fidelity between two qubits

• tensorflow_fit_gate.py

Tensorflow example. Given an arbitrary one-qubit gate, use gradient descent to find corresponding parameters of a universal ZYZ gate.

• eager_fit_gate.py

Tensorflow eager mode example. Given an arbitrary one-qubit gate, use gradient descent to find corresponding parameters of a universal ZYZ gate.