qml.qchem.clifford

clifford(generators, paulixops)[source]

Compute a Clifford operator from a set of generators and Pauli-X operators.

This function computes \(U = U_0U_1...U_k\) for a set of \(k\) generators and \(k\) Pauli-X operators.

Parameters
  • generators (list[Operator]) – generators expressed as PennyLane Hamiltonians

  • paulixops (list[Operation]) – list of single-qubit Pauli-X operators

Returns

Clifford operator expressed as a PennyLane operator

Return type

(Operator)

Example

>>> t1 = qml.Hamiltonian([1.0], [qml.pauli.string_to_pauli_word('ZZII')])
>>> t2 = qml.Hamiltonian([1.0], [qml.pauli.string_to_pauli_word('ZIZI')])
>>> t3 = qml.Hamiltonian([1.0], [qml.pauli.string_to_pauli_word('ZIIZ')])
>>> generators = [t1, t2, t3]
>>> paulixops = [qml.X(1), qml.X(2), qml.X(3)]
>>> u = clifford(generators, paulixops)
>>> print(u)
  (0.3535533905932737) [Z1 Z2 X3]
+ (0.3535533905932737) [X1 X2 X3]
+ (0.3535533905932737) [Z1 X2 Z3]
+ (0.3535533905932737) [X1 Z2 Z3]
+ (0.3535533905932737) [Z0 X1 X2 Z3]
+ (0.3535533905932737) [Z0 Z1 Z2 Z3]
+ (0.3535533905932737) [Z0 X1 Z2 X3]
+ (0.3535533905932737) [Z0 Z1 X2 X3]