# majority_gate¶

forest.benchmarking.classical_logic.majority_gate(a: int, b: int, c: int, in_x_basis: bool = False) → pyquil.quil.Program

The majority gate.

Computes (a * b) xor (a * c) xor (b * c) where * is multiplication mod 2.

The default option is to compute this in the computational (aka Z) basis. If in_x_basis is true then the computation is instead in the X basis, i.e. CNOT is replaced by CNOT_X_basis and CCNOT is replaced by CCNOT_X_basis