qiskit-documentation/docs/api/qiskit/0.29/qiskit.opflow.evolutions.QD...

59 lines
1.7 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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: QDrift (v0.29)
description: API reference for qiskit.opflow.evolutions.QDrift in qiskit v0.29
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.opflow.evolutions.QDrift
---
# QDrift
<Class id="qiskit.opflow.evolutions.QDrift" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.18/qiskit/opflow/evolutions/trotterizations/qdrift.py" signature="QDrift(reps=1)" modifiers="class">
Bases: `qiskit.opflow.evolutions.trotterizations.trotterization_base.TrotterizationBase`
The QDrift Trotterization method, which selects each each term in the Trotterization randomly, with a probability proportional to its weight. Based on the work of Earl Campbell in [https://arxiv.org/abs/1811.08017](https://arxiv.org/abs/1811.08017).
**Parameters**
**reps** (`int`) The number of times to repeat the Trotterization circuit.
## Methods Defined Here
<span id="qiskit-opflow-evolutions-qdrift-convert" />
### convert
<Function id="qiskit.opflow.evolutions.QDrift.convert" signature="QDrift.convert(operator)">
Convert a `SummedOp` into a `ComposedOp` or `CircuitOp` representing an approximation of e^-i\*\`\`op\_sum\`\`.
**Parameters**
**operator** (`OperatorBase`) The `SummedOp` to evolve.
**Return type**
`OperatorBase`
**Returns**
The Operator approximating op\_sums evolution.
**Raises**
**TypeError** A non-SummedOps Operator is passed into `convert`.
</Function>
## Attributes
### reps
<Attribute id="qiskit.opflow.evolutions.QDrift.reps">
The number of repetitions to use in the Trotterization, improving the approximation accuracy.
**Return type**
`int`
</Attribute>
</Class>