qiskit-documentation/docs/api/qiskit/0.26/qiskit.aqua.circuits.ESOP.mdx

133 lines
5.8 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: ESOP (v0.26)
description: API reference for qiskit.aqua.circuits.ESOP in qiskit v0.26
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.aqua.circuits.ESOP
---
<span id="qiskit-aqua-circuits-esop" />
# qiskit.aqua.circuits.ESOP
<Class id="qiskit.aqua.circuits.ESOP" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/circuits/boolean_logical_circuits.py" signature="ESOP(ast, num_vars=None)" modifiers="class">
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**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") invalid input
### \_\_init\_\_
<Function id="qiskit.aqua.circuits.ESOP.__init__" signature="__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**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") invalid input
</Function>
## Methods
| | |
| ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [`__init__`](#qiskit.aqua.circuits.ESOP.__init__ "qiskit.aqua.circuits.ESOP.__init__")(ast\[, num\_vars]) | Constructor. |
| [`compute_num_ancillae`](#qiskit.aqua.circuits.ESOP.compute_num_ancillae "qiskit.aqua.circuits.ESOP.compute_num_ancillae")(\[mct\_mode]) | returns the number of ancillary qubits needed |
| [`construct_circuit`](#qiskit.aqua.circuits.ESOP.construct_circuit "qiskit.aqua.circuits.ESOP.construct_circuit")(\[circuit, …]) | Construct circuit. |
## Attributes
| | |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| [`ancillary_register`](#qiskit.aqua.circuits.ESOP.ancillary_register "qiskit.aqua.circuits.ESOP.ancillary_register") | returns ancillary register |
| [`clause_register`](#qiskit.aqua.circuits.ESOP.clause_register "qiskit.aqua.circuits.ESOP.clause_register") | returns clause register |
| [`num_clauses`](#qiskit.aqua.circuits.ESOP.num_clauses "qiskit.aqua.circuits.ESOP.num_clauses") | returns num clauses |
| [`num_variables`](#qiskit.aqua.circuits.ESOP.num_variables "qiskit.aqua.circuits.ESOP.num_variables") | return num variables |
| [`output_register`](#qiskit.aqua.circuits.ESOP.output_register "qiskit.aqua.circuits.ESOP.output_register") | returns output register |
| [`variable_register`](#qiskit.aqua.circuits.ESOP.variable_register "qiskit.aqua.circuits.ESOP.variable_register") | returns variable register |
### ancillary\_register
<Attribute id="qiskit.aqua.circuits.ESOP.ancillary_register">
returns ancillary register
</Attribute>
### clause\_register
<Attribute id="qiskit.aqua.circuits.ESOP.clause_register">
returns clause register
</Attribute>
### compute\_num\_ancillae
<Function id="qiskit.aqua.circuits.ESOP.compute_num_ancillae" signature="compute_num_ancillae(mct_mode='basic')">
returns the number of ancillary qubits needed
</Function>
### construct\_circuit
<Function id="qiskit.aqua.circuits.ESOP.construct_circuit" signature="construct_circuit(circuit=None, variable_register=None, output_register=None, output_idx=None, ancillary_register=None, mct_mode='basic')">
Construct circuit.
**Parameters**
* **circuit** ([*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")) The optional circuit to extend from
* **variable\_register** ([*QuantumRegister*](qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) The optional quantum
* **to use for problem variables** (*register*)
* **output\_register** ([*QuantumRegister*](qiskit.circuit.QuantumRegister "qiskit.circuit.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*](qiskit.circuit.QuantumRegister "qiskit.circuit.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**
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
**Raises**
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") invalid input
</Function>
### num\_clauses
<Attribute id="qiskit.aqua.circuits.ESOP.num_clauses">
returns num clauses
</Attribute>
### num\_variables
<Attribute id="qiskit.aqua.circuits.ESOP.num_variables">
return num variables
</Attribute>
### output\_register
<Attribute id="qiskit.aqua.circuits.ESOP.output_register">
returns output register
</Attribute>
### variable\_register
<Attribute id="qiskit.aqua.circuits.ESOP.variable_register">
returns variable register
</Attribute>
</Class>