mindquantum.utils

mindquantum.utils#

Utils.

Function#

API Name

Description

fdopen(fname, mode[, ...])

Context manager for opening files with correct permissions.

ket_string(state[, tol])

Get the ket format of the quantum state.

mod(vec_in[, axis])

Calculate the mod of input vectors.

normalize(vec_in[, axis])

Normalize the input vectors based on specified axis.

random_circuit(n_qubits, ...)

Generate a random circuit.

random_state(shapes[, ...])

Generate some random quantum state.

random_hamiltonian(...[, ...])

Generate a random Pauli Hamiltonian.

random_insert_gates(...[, ...])

Randomly insert given numbers of single-qubit gates into a quantum circuit.

Progress bar#

API Name

Description

SingleLoopProgress(n_loop)

A progress bar of task with single level for loop.

TwoLoopsProgress(...[, ...])

A progress bar of task with two level for loops.