Module: cirq.qis

Tools and methods for quantum information science.


measures module: Measures on and between quantum states and operations.

states module: Classes and methods for quantum states.


class QuantumState: A quantum state.


bloch_vector_from_state_vector(...): Returns the bloch vector of a qubit.

density_matrix(...): Create a QuantumState object from a density matrix.

density_matrix_from_state_vector(...): Returns the density matrix of the state vector.

dirac_notation(...): Returns the state vector as a string in Dirac notation.

eye_tensor(...): Returns an identity matrix reshaped into a tensor.

fidelity(...): Fidelity of two quantum states.

one_hot(...): Returns a numpy array with all 0s and a single non-zero entry(default 1).

quantum_state(...): Create a QuantumState object from a state-like object.

to_valid_density_matrix(...): Verifies the density_matrix_rep is valid and converts it to ndarray form.

to_valid_state_vector(...): Verifies the state_rep is valid and converts it to ndarray form.

validate_density_matrix(...): Checks that the given density matrix is valid.

validate_indices(...): Validates that the indices have values within range of num_qubits.

validate_normalized_state_vector(...): Checks that the given state vector is valid.

validate_qid_shape(...): Validates the size of the given state_vector against the given shape.

von_neumann_entropy(...): Calculates the von Neumann entropy of a quantum state in bits.

Type Aliases

QUANTUM_STATE_LIKE: An object representing a quantum state.

STATE_VECTOR_LIKE: An object representing a state vector.