Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

RYRZ

RYRZ(num_qubits, depth=3, entangler_map=None, entanglement='full', initial_state=None, entanglement_gate='cz', skip_unentangled_qubits=False)

GitHub(opens in a new tab)

DEPRECATED. The RYRZ Variational Form.

The RYRZ trial wave function is layers of yy plus zz rotations with entanglements. When none of qubits are unentangled to other qubits, the number of optimizer parameters this form creates and uses is given by q×(d+1)×2q \times (d + 1) \times 2, where qq is the total number of qubits and dd is the depth of the circuit. Nonetheless, in some cases, if an entangler_map does not include all qubits, that is, some qubits are not entangled by other qubits. The number of parameters is reduced by d×q×2d \times q' \times 2 where qq' is the number of unentangled qubits. This is because adding more parameters to the unentangled qubits only introduce overhead without bringing any benefit; furthermore, theoretically, applying multiple Ry and Rz gates in a row can be reduced to a single Ry gate and one Rz gate with the summed rotation angles.

See RY for more detail on entangler_map and entanglement which apply here too but note RYRZ only supports ‘full’ and ‘linear’ values.

Parameters

  • num_qubits (int) – Number of qubits, has a minimum value of 1.
  • depth (int) – Number of rotation layers, has a minimum value of 1.
  • entangler_map (Optional[List[List[int]]]) – Describe the connectivity of qubits, each list pair describes [source, target], or None for as defined by entanglement. Note that the order is the list is the order of applying the two-qubit gate.
  • entanglement (str) – (‘full’ | ‘linear’) overridden by ‘entangler_map` if its provided. ‘full’ is all-to-all entanglement, ‘linear’ is nearest-neighbor.
  • initial_state (Optional[InitialState]) – An initial state object
  • entanglement_gate (str) – (‘cz’ | ‘cx’)
  • skip_unentangled_qubits (bool) – Skip the qubits not in the entangler_map

Attributes

num_parameters

Number of parameters of the variational form.

Returns

An integer indicating the number of parameters.

Return type

int

num_qubits

Number of qubits of the variational form.

Returns

An integer indicating the number of qubits.

Return type

int

parameter_bounds

Parameter bounds.

Returns

A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If None is returned, problem is fully unbounded.

Return type

list

preferred_init_points

Return preferred init points.

If an initial state is provided then the variational form may provide back this set of parameters which when used on the variational form should result in the overall state being that defined by the initial state

setting

support_parameterized_circuit

Whether or not the sub-class support parameterized circuit.

Returns

indicate the sub-class support parameterized circuit

Return type

boolean


Methods

construct_circuit

RYRZ.construct_circuit(parameters, q=None)

Construct the variational form, given its parameters.

Parameters

Returns

a quantum circuit with given parameters

Return type

QuantumCircuit

Raises

ValueError – the number of parameters is incorrect.

get_entangler_map

static RYRZ.get_entangler_map(map_type, num_qubits, offset=0)

returns entangler map

validate_entangler_map

static RYRZ.validate_entangler_map(entangler_map, num_qubits)

validate entangler map

Was this page helpful?
Report a bug or request content on GitHub.