cutqc2.library.Dynamics package

Submodules

cutqc2.library.Dynamics.quantum_dynamics module

class cutqc2.library.Dynamics.quantum_dynamics.Dynamics(H, barriers=False, measure=False, regname=None)[source]

Bases: object

Class to implement the simulation of quantum dynamics as described in Section 4.7 of Nielsen & Chuang (Quantum computation and quantum information (10th anniv. version), 2010.)

A circuit implementing the quantum simulation can be generated for a given problem Hamiltonian parameterized by calling the gen_circuit() method.

H

The given Hamiltonian whose dynamics we want to simulate

Type:

??

barriers

should barriers be included in the generated circuit

Type:

bool

measure

should a ClassicalRegister and measurements be added to the circuit

Type:

bool

regname

optional string to name the quantum and classical registers. This allows for the easy concatenation of multiple QuantumCircuits.

Type:

str

qr

Qiskit QuantumRegister holding all of the quantum bits

Type:

QuantumRegister

circ

Qiskit QuantumCircuit that represents the uccsd circuit

Type:

QuantumCircuit

apply_phase_shift(delta_t)[source]

Simulate the evolution of exp(-i(dt)Z)

compute_to_Z_basis(pauli_str)[source]

Take the given pauli_str of the form ABCD and apply operations to the circuit which will take it from the ABCD basis to the ZZZZ basis

Parameters:

pauli_str (str) – string of the form ‘p1p2p3…pN’ where pK is a Pauli matrix

gen_circuit()[source]

Create a circuit implementing the quantum dynamics simulation

Returns:

QuantumCircuit object of size nq with no ClassicalRegister and no measurements

Return type:

QuantumCircuit

get_num_qubits()[source]

Given the problem Hamiltonian, return the appropriate number of qubits needed to simulate its dynamics.

This number does not include the single ancilla qubit that is added to the circuit.

uncompute_to_Z_basis(pauli_str)[source]

Take the given pauli_str of the form ABCD and apply operations to the circuit which will take it from the ZZZZ basis to the ABCD basis

Parameters:

pauli_str (str) – string of the form ‘p1p2p3…pN’ where pK is a Pauli matrix

Module contents