The Amplifier Function

The amplifier function

The next gate we create is the amplifier. So far, we learned the amplifier to consist of a controlled ZZ-gate encapsulated into Hadamard and NOTNOT-gates. Our amplifier is almost alike. However, we do not use Hadamard gates, but we use a part of the actual implementation of our quantum Bayesian network instead. We use the function apply_ischild_sex we created in the lesson Estimating a Variable. Basically, this function applies RY​​R​Y​​-gates on the qubits at the positions QPOS_SEX and QPOS_ISCHILD by the angle representing the corresponding marginal probabilities.

The rest of the amplifier remains the standard amplifier we already know. Again, we apply a controlled ZZ-gate inside NOTNOT-gates. However, this time, we must apply the controlled ZZ-gate only on the two qubits whose state we want to amplify. These are the qubits at the positions QPOS_SEX and QPOS_ISCHILD in line 8.

Get hands-on with 1400+ tech skills courses.