English
Languages
English
Japanese
German
Korean
Portuguese, Brazilian
French
Shortcuts

qiskit.aqua.circuits.DNF

class DNF(ast, num_vars=None)[source]

Class for constructing circuits for Disjunctive Normal Forms

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

ancillary_register

returns ancillary register

clause_register

returns clause register

num_clauses

returns num clauses

num_variables

return num variables

output_register

returns output register

variable_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, clause_register=None, output_register=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 register to use for problem variables

  • clause_register (QuantumRegister) – The optional quantum register to use for problem clauses

  • output_register (QuantumRegister) – The optional quantum register to use for holding the output

  • 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

QuantumCircuit

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