# How do I construct a Breidbart gate in Qiskit?

How do I construct a Breidbart gate (which is like the Hadamard gate but with $$\pi/8$$ instead of rotating by $$\pi/4$$)? I want to use it to perform measurement in the Breidbart Basis, by measuring in the Z basis afterwards.

• The Hadamard gate is actually a rotation by $\pi$ about the $x+z$ axis (it looks similar to a $\pi/2$ rotation about the $y$ axis). You're looking for unitaries of the form $\exp(i \theta \mathbf{r}\cdot\mathbf{\sigma}/2)$, where $\mathbf{\sigma}$ are the Pauli matrices, $\mathbf{r}$ is the axis of rotation, and $\theta$ is the angle of rotation Jun 11 at 23:21
• I was visualizing vectors as real vectors, therefore on the "classic" unit circle where Hadamard would be pi/2. I understand that on the Bloch sphere it is pi. But anyways how do I do a rotation of pi/2 on the Bloch sphere using only qiskit primitives ? It seems we can't chose arbitrary parameters otherwise we could just input a parametrized unitary matrix of the form you give. Jun 12 at 7:26
• @hehehe On the "classic unit circle" the Hadamard is not a rotation. It's a reflection. Regardless, in order to answer your question, we need to know what your building blocks are. Are you using a specific gate set? A specific programming language? Jun 12 at 13:07
• @CraigGidney You are right, it's not exactly a rotation, the first vector is rotated by pi/4, but the second basis vector is first rotated by pi/4 then reflected. My question more generally is thus : How to implement any rotation of arbitrary angle (or even reflection) on the classic unit circle using only what's provided by qiskit (here qiskit gates are my building blocks) ? The breidbart gate corresponds to pi/8 (or pi/4 on bloch sphere) and is of interest in the attack analysis of bb84. Jun 12 at 15:12