quantumCircuit
Installation Required: This functionality requires MATLAB Support Package for Quantum Computing.
Description
A quantumCircuit
object represents a quantum computing circuit
with a specific number of qubits and gates. An example of a quantum circuit with two qubits
and two gates is shown in this diagram.
Each solid horizontal line in the diagram represents a qubit. The symbols and represent the gates that operate on the qubits. The symbols represent the Hadamard gate and the controlled X gate, respectively. For more details about quantum circuits, see Quantum Circuit.
Creation
Syntax
Description
creates a quantum computing circuit with the specified number of qubits and no
gates.c
= quantumCircuit(numQubits
)
This syntax sets the NumQubits property to
numQubits
.
creates a quantum computing circuit with the specified quantum gates and number of qubits.
The input c
= quantumCircuit(gates
,numQubits
)numQubits
must be greater than or equal to the largest qubit
index used in gates
.
Input Arguments
Properties
Object Functions
Examples
Version History
Introduced in R2023a