API Reference: qiskit.circuit.QuantumCircuit.rx
The QuantumCircuit.rx method appends a parameterized rotation around the X axis of the Bloch sphere. The main parameters are theta, representing the rotation angle in radians, and qubit, representing the qubit to which the operation is applied.
The mathematical form of the operation is \(R_X(\theta)=e^{-i\theta X/2}\). When the angle is supplied as a symbolic parameter, the circuit can be bound later during optimization, making this method useful for VQE, QAOA, and gradient-based circuit training.
Parameters
| Parameter Name | Type | Description |
|---|---|---|
theta |
float | ParameterExpression |
The rotation angle in radians. |
qubit |
int | Qubit |
The target qubit that receives the X-axis rotation. |
from qiskit import QuantumCircuit
qc = QuantumCircuit(1)
theta = 1.57079632679
qc.rx(theta, 0)
Example Output
{
"status": "success",
"operation": "RXRotation",
"theta": 1.57079632679,
"target": 0
}