qc2.ansatz.qiskit.gate_fabric

Classes

GateFabric

Gate Fabric ansatz implementation for Qiskit.

Module Contents

class qc2.ansatz.qiskit.gate_fabric.GateFabric(num_spatial_orbitals: int, num_particles: tuple, qubit_mapper: qiskit_nature.second_q.mappers.QubitMapper, initial_state: qiskit.circuit.QuantumCircuit | None = None, num_layers: int = 1, include_pi: bool = False, name: str | None = 'GateFabric')[source]

Bases: qiskit.circuit.library.blueprintcircuit.BlueprintCircuit

Gate Fabric ansatz implementation for Qiskit.

_num_qubits[source]
_num_spatial_orbitals[source]
_num_particles[source]
_qubit_mapper[source]
_num_layers = 1[source]
_include_pi = False[source]
_initial_state[source]
property qubit_mapper: qiskit_nature.second_q.mappers.QubitMapper | None[source]

The qubit operator mapper.

property num_qubits: int[source]

The number of qubits.

property num_spatial_orbitals: int[source]

The number of spatial orbitals.

property num_particles: tuple[int, int][source]

The number of particles.

_check_configuration(raise_on_failure: bool = True) bool[source]

Check if the configuration of the NLocal class is valid.

Parameters:

raise_on_failure – Whether to raise on failure.

Returns:

True, if the configuration is valid and the circuit can be constructed. Otherwise an ValueError is raised.

Raises:
  • ValueError – If the numbr fo qubit is not set.

  • ValueError – If the number of spatial orbitals is lower than the number of particles

_build() None[source]

Builds the Gate Fabric circuit

_gate_fabric_layer(circuit: qiskit.circuit.QuantumCircuit, parameters: list, wires: list) None[source]

Implements a single layer of Gate Fabric

_orbital_rotation(circuit: qiskit.circuit.QuantumCircuit, theta: qiskit.circuit.Parameter, qubits: list) None[source]

Implements the orbital rotation gate

_double_excitation(circuit: qiskit.circuit.QuantumCircuit, phi: qiskit.circuit.Parameter, qubits: list) None[source]

Implements the double excitation gate