qiskit.aqua.circuits.ESOP¶
-
class
ESOP
(ast, num_vars=None)[source]¶ Class for constructing circuits for Exclusive Sum of Products
Constructor.
- Parameters
ast (tuple) – The logic expression as an Abstract Syntax Tree (AST) tuple
num_vars (int) – Number of boolean variables
- Raises
AquaError – invalid input
-
__init__
(ast, num_vars=None)¶ Constructor.
- Parameters
ast (tuple) – The logic expression as an Abstract Syntax Tree (AST) tuple
num_vars (int) – Number of boolean variables
- Raises
AquaError – invalid input
Methods
__init__
(ast[, num_vars])Constructor.
compute_num_ancillae
([mct_mode])returns the number of ancillary qubits needed
construct_circuit
([circuit, …])Construct circuit.
Attributes
returns ancillary register
returns clause register
returns num clauses
return num variables
returns output register
returns variable register
-
property
ancillary_register
¶ returns ancillary register
-
property
clause_register
¶ returns clause register
-
compute_num_ancillae
(mct_mode='basic')¶ returns the number of ancillary qubits needed
-
construct_circuit
(circuit=None, variable_register=None, output_register=None, output_idx=None, ancillary_register=None, mct_mode='basic')[source]¶ Construct circuit.
- Parameters
circuit (QuantumCircuit) – The optional circuit to extend from
variable_register (QuantumRegister) – The optional quantum
to use for problem variables (register) –
output_register (QuantumRegister) – The optional quantum
to use for holding the output (register) –
output_idx (int) – The index of the output register to write to
ancillary_register (QuantumRegister) – The optional quantum register to use as ancilla
mct_mode (str) – The mode to use for building Multiple-Control Toffoli
- Returns
quantum circuit.
- Return type
- Raises
AquaError – invalid input
-
property
num_clauses
¶ returns num clauses
-
property
num_variables
¶ return num variables
-
property
output_register
¶ returns output register
-
property
variable_register
¶ returns variable register