scikit_quri.state package#
Submodules#
scikit_quri.state.overlap_estimator module#
- class scikit_quri.state.overlap_estimator.OverlapEstimator(concurrent_sampler, n_shots=1000)[source]#
Bases:
objectAlternative implementation of quri-parts’ overlap estimator.
- Parameters:
concurrent_sampler (BaseSampler) –
n_shots (int) –
- create_overlap_circuit(ket_circuit, bra_circuit)[source]#
Create a circuit to compute the overlap between two quantum states. Operates non-destructively on the input circuits.
- Parameters:
ket_circuit (QuantumCircuit) – Quantum circuit representing the ket state.
bra_circuit (QuantumCircuit) – Quantum circuit representing the bra state.
- Returns:
A quantum circuit of the form U_ket U_bra†, whose |0⟩ measurement probability approximates |⟨ψ_ket|ψ_bra⟩|².
- Return type:
QuantumCircuit
- estimate(ket_circuit, bra_circuit)[source]#
Estimate the squared overlap |⟨ψ_ket|ψ_bra⟩|² between two quantum states. Operates non-destructively on the input circuits.
- estimate_concurrent(ket_circuits, bra_circuits, batch_size=100)[source]#
Estimate |⟨ψ_i|ψ_j⟩|² for all combinations of ket and bra circuits.
- Parameters:
ket_circuits (list[quri_parts.rust.circuit.circuit.QuantumCircuit]) – List of quantum circuits representing ket states.
bra_circuits (list[quri_parts.rust.circuit.circuit.QuantumCircuit]) – List of quantum circuits representing bra states.
batch_size (int) – Number of circuits sent to the sampler at once. Bounds peak memory at O(batch_size) instead of O(n_ket * n_bra).
- Returns:
Flat array of shape (n_ket * n_bra,) containing the squared overlaps for all (ket, bra) pairs in row-major order.
- Return type:
Module contents#
- class scikit_quri.state.OverlapEstimator(concurrent_sampler, n_shots=1000)[source]
Bases:
objectAlternative implementation of quri-parts’ overlap estimator.
- Parameters:
concurrent_sampler (BaseSampler) –
n_shots (int) –
- create_overlap_circuit(ket_circuit, bra_circuit)[source]
Create a circuit to compute the overlap between two quantum states. Operates non-destructively on the input circuits.
- Parameters:
ket_circuit (QuantumCircuit) – Quantum circuit representing the ket state.
bra_circuit (QuantumCircuit) – Quantum circuit representing the bra state.
- Returns:
A quantum circuit of the form U_ket U_bra†, whose |0⟩ measurement probability approximates |⟨ψ_ket|ψ_bra⟩|².
- Return type:
QuantumCircuit
- estimate(ket_circuit, bra_circuit)[source]
Estimate the squared overlap |⟨ψ_ket|ψ_bra⟩|² between two quantum states. Operates non-destructively on the input circuits.
- estimate_concurrent(ket_circuits, bra_circuits, batch_size=100)[source]
Estimate |⟨ψ_i|ψ_j⟩|² for all combinations of ket and bra circuits.
- Parameters:
ket_circuits (list[quri_parts.rust.circuit.circuit.QuantumCircuit]) – List of quantum circuits representing ket states.
bra_circuits (list[quri_parts.rust.circuit.circuit.QuantumCircuit]) – List of quantum circuits representing bra states.
batch_size (int) – Number of circuits sent to the sampler at once. Bounds peak memory at O(batch_size) instead of O(n_ket * n_bra).
- Returns:
Flat array of shape (n_ket * n_bra,) containing the squared overlaps for all (ket, bra) pairs in row-major order.
- Return type: