TransWikia.com

How to remove ancilla bits from results?

Quantum Computing Asked by Requiem on August 20, 2021

I have a circuit with 2 ancilla bits. I have only asked that the circuit measure the 4 other qubits, but the results keep including the ancilla bits. How to remove the ancilla bits from the results?

One Answer

You can (and you should) always uncomputer ancilla qubits. This can be done by application of inverse gates in inverse order to original ones which prepared states of ancilla qubits.

Here is an example:

Circuit

The purpose of the circuit is to calculate $q_0 ,text{AND}, q_1 ,text{AND} q_2$. To do so, firstly $q_0 ,text{AND}, q_1$ is calculated and result is stored to ancilla $q_3$. After that final result is obtained by $q_2 ,text{AND}, q_3$ and stored to $q_4$. Finnaly, inverse operation (note that inverse gate to Toffoli is again Toffoli) is applied. As a result, state of ancilla $q_3$ is returned back to $|0rangle$. This value is returned during measurement. If you do not want to include ancilla to measurement, simply do not put the measurement on qubit $q_3$.

Answered by Martin Vesely on August 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP