-
Notifications
You must be signed in to change notification settings - Fork 946
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #446 from rawkintrevo/mahout-2210
Mahout 2210 Docs
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# QuMat Class Methods | ||
|
||
## `__init__(self, backend_config)` | ||
- **Purpose**: Initializes the QuMat instance with a specific backend. | ||
- **Parameters**: | ||
- `backend_config` (dict): Configuration for the backend including its name and options. | ||
- **Usage**: Used to set up the quantum computing backend based on user configuration. | ||
|
||
## `create_empty_circuit(self, num_qubits)` | ||
- **Purpose**: Creates an empty quantum circuit with a specified number of qubits. | ||
- **Parameters**: | ||
- `num_qubits` (int): Number of qubits in the quantum circuit. | ||
- **Usage**: Used at the start of quantum computations to prepare a new quantum circuit. | ||
|
||
## `apply_not_gate(self, qubit_index)` | ||
- **Purpose**: Applies a NOT gate (quantum equivalent of a classical NOT) to a specified qubit. | ||
- **Parameters**: | ||
- `qubit_index` (int): Index of the qubit to which the gate is applied. | ||
- **Usage**: Used to flip the state of a qubit from 0 to 1 or from 1 to 0. | ||
|
||
## `apply_hadamard_gate(self, qubit_index)` | ||
- **Purpose**: Applies a Hadamard gate to a specified qubit. | ||
- **Parameters**: | ||
- `qubit_index` (int): Index of the qubit. | ||
- **Usage**: Used to create a superposition state, allowing the qubit to be both 0 and 1 simultaneously. | ||
|
||
## `apply_cnot_gate(self, control_qubit_index, target_qubit_index)` | ||
- **Purpose**: Applies a Controlled-NOT (CNOT) gate between two qubits. | ||
- **Parameters**: | ||
- `control_qubit_index` (int): Index of the control qubit. | ||
- `target_qubit_index` (int): Index of the target qubit. | ||
- **Usage**: Fundamental for entangling qubits, which is essential for quantum algorithms. | ||
|
||
## `apply_toffoli_gate(self, control_qubit_index1, control_qubit_index2, target_qubit_index)` | ||
- **Purpose**: Applies a Toffoli gate (CCX gate) to three qubits. | ||
- **Parameters**: | ||
- `control_qubit_index1` (int): Index of the first control qubit. | ||
- `control_qubit_index2` (int): Index of the second control qubit. | ||
- `target_qubit_index` (int): Index of the target qubit. | ||
- **Usage**: Acts as a quantum AND gate, used in algorithms requiring conditional logic. | ||
|
||
## `apply_swap_gate(self, qubit_index1, qubit_index2)` | ||
- **Purpose**: Swaps the states of two qubits. | ||
- **Parameters**: | ||
- `qubit_index1` (int): Index of the first qubit. | ||
- `qubit_index2` (int): Index of the second qubit. | ||
- **Usage**: Useful in quantum algorithms for rearranging qubit states. | ||
|
||
## `apply_pauli_x_gate(self, qubit_index)` | ||
- **Purpose**: Applies a Pauli-X gate to a specified qubit. | ||
- **Parameters**: | ||
- `qubit_index` (int): Index of the qubit. | ||
- **Usage**: Equivalent to a NOT gate, flips the qubit state. | ||
|
||
## `apply_pauli_y_gate(self, qubit_index)` | ||
- **Purpose**: Applies a Pauli-Y gate to a specified qubit. | ||
- **Parameters**: | ||
- `qubit_index` (int): Index of the qubit. | ||
- **Usage**: Impacts the phase and amplitude of a qubit’s state. | ||
|
||
## `apply_pauli_z_gate(self, qubit_index)` | ||
- **Purpose**: Applies a Pauli-Z gate to a specified qubit. | ||
- **Parameters**: | ||
- `qubit_index` (int): Index of the qubit. | ||
- **Usage**: Alters the phase of a qubit without changing its amplitude. | ||
|
||
## `execute_circuit(self)` | ||
- **Purpose**: Executes the quantum circuit and retrieves the results. | ||
- **Usage**: Used to run the entire set of quantum operations and measure the outcomes. |