Circuit Implementation
Explore how to implement Quantum Bayesian Networks by representing binary variables as qubits, initializing node probabilities with rotation gates, and applying controlled-controlled rotation gates to model conditional probabilities for the Titanic survival dataset.
We start with implementing our example thus far, which was to determine the effect the Sex of a passenger and being a child (isChild) had on the Survival of the Titanic shipwreck.
A qubit represents each node in the Bayesian network. Since all our nodes in this dataset are presented as binary (Sex, isChild, Survival), a single qubit each will be sufficient. If we had more discrete states or a continuous distribution, we would need more qubits. The qubit states represent the marginal (for root nodes) and the conditional (for Survival node) probability amplitudes of the corresponding variables.
The state represents a male passenger or an adult. The state represents a female or a child. The superposition of the qubit denotes the probability of either state.