|
Sequential Quantum Gate Decomposer
v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Classes | |
| class | qgd_Variational_Quantum_Eigensolver_Base |
| A QGD Python interface class for the decomposition of N-qubit unitaries into U3 and CNOT gates. More... | |
Functions | |
| def | __init__ (self, Hamiltonian, qbit_num, config=None, accelerator_num=0, backend=None, density_noise=None) |
| Constructor of the class. More... | |
| def | _normalize_density_noise_spec (density_noise) |
| def | _normalize_vqe_backend_name (backend) |
| def | apply_to (self, parameters_mtx, state_to_be_transformed) |
| def | describe_density_bridge (self) |
| Return reviewable metadata for the currently supported density bridge. More... | |
| def | Generate_Circuit (self, layers, inner_blocks=1) |
| Call to generate the circuit ansatz. More... | |
| def | get_Circuit (self) |
| Call to retrieve the incorporated quantum circuit (Squander format) More... | |
| def | get_Optimized_Parameters (self) |
| Call to get the optimized parameters set in numpy array. More... | |
| def | get_Parameter_Num (self) |
| Call to get the number of free parameters in the gate structure used for the decomposition. More... | |
| def | get_Qbit_Num (self) |
| Call to get the number of qubits in the circuit. More... | |
| def | get_Qiskit_Circuit (self) |
| Export the unitary decomposition into Qiskit format. More... | |
| def | get_Second_Renyi_Entropy (self, parameters=None, input_state=None, qubit_list=None) |
| Call to get the second Rényi entropy. More... | |
| def | Optimization_Problem (self, parameters) |
| Call to evaluate the VQE energy. More... | |
| def | Optimization_Problem_Grad (self, parameters) |
| Call to evaluate the VQE energy. More... | |
| def | set_Ansatz (self, ansatz_new) |
| Call to set the ansatz type. More... | |
| def | set_Density_Matrix_Noise (self, density_noise) |
| Configure ordered fixed local-noise insertions for the density backend. More... | |
| def | set_Gate_Structure (self, Gate_structure) |
| Call to set custom gate structure to used in the decomposition. More... | |
| def | set_Gate_Structure_from_Binary (self, filename) |
| Call to set custom layers to the gate structure that are intended to be used in the decomposition from a binary file created from SQUANDER. More... | |
| def | set_Initial_State (self, initial_state) |
| Call to get the number of free parameters in the gate structure used for the decomposition. More... | |
| def | set_Optimization_Tolerance (self, tolerance) |
| def | set_Optimized_Parameters (self, new_params) |
| Call to set the parameters which are used as a starting point in the optimization. More... | |
| def | set_Optimizer (self, alg) |
| Call to set the optimizer used in the VQE process. More... | |
| def | set_Project_Name (self, project_name) |
| Call to set the name of the SQUANDER project. More... | |
| def | Start_Optimization (self) |
| Call to start solving the VQE problem to get the approximation for the ground state. More... | |
Variables | |
| _DENSITY_NOISE_CHANNEL_SPECS | |
| _VQE_BACKEND_CONFIG_KEY | |
| _VQE_BACKEND_NAME_TO_CODE | |
| _VQE_DEFAULT_BACKEND | |
| backend | |
| density_noise | |
| qbit_num | |
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.__init__ | ( | self, | |
| Hamiltonian, | |||
| qbit_num, | |||
config = None, |
|||
accelerator_num = 0, |
|||
backend = None, |
|||
density_noise = None |
|||
| ) |
Constructor of the class.
| Umtx | The unitary matrix to be decomposed. |
| config | Dictionary describing optimization hyperparameters. |
| accelerator_num | Optional accelerator identifier. |
| backend | Optional backend selector. Supported values are "state_vector" and "density_matrix". When omitted, the VQE keeps the legacy state-vector behavior. Explicit backend="density_matrix" activates the supported exact noisy mixed-state energy path for the Phase 2 anchor workflow. |
| density_noise | Optional ordered list of fixed local density-noise insertions. Each entry must define a channel, target qubit, after_gate_index, and fixed noise value. The canonical Phase 2 local-noise channels are local_depolarizing, amplitude_damping, and phase_damping; the aliases depolarizing and dephasing normalize to the local canonical names. Phase 2 only supports this surface together with backend="density_matrix" on the supported HEA anchor circuit. |
Definition at line 175 of file qgd_Variational_Quantum_Eigensolver_Base.py.

|
private |
Definition at line 68 of file qgd_Variational_Quantum_Eigensolver_Base.py.

|
private |
Definition at line 48 of file qgd_Variational_Quantum_Eigensolver_Base.py.

| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.apply_to | ( | self, | |
| parameters_mtx, | |||
| state_to_be_transformed | |||
| ) |
Definition at line 345 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.describe_density_bridge | ( | self | ) |
Return reviewable metadata for the currently supported density bridge.
Definition at line 404 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.Generate_Circuit | ( | self, | |
| layers, | |||
inner_blocks = 1 |
|||
| ) |
Call to generate the circuit ansatz.
| layers | The number of layers. The depth of the generated circuit is 2*layers+1 (U3-CNOT-U3-CNOT...CNOT) |
| inner_blocks | The number of U3-CNOT repetition within a single layer |
Definition at line 264 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.get_Circuit | ( | self | ) |
Call to retrieve the incorporated quantum circuit (Squander format)
Definition at line 354 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.get_Optimized_Parameters | ( | self | ) |
Call to get the optimized parameters set in numpy array.
Definition at line 218 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.get_Parameter_Num | ( | self | ) |
Call to get the number of free parameters in the gate structure used for the decomposition.
Definition at line 336 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.get_Qbit_Num | ( | self | ) |
Call to get the number of qubits in the circuit.
Definition at line 329 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.get_Qiskit_Circuit | ( | self | ) |
Export the unitary decomposition into Qiskit format.
Definition at line 364 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.get_Second_Renyi_Entropy | ( | self, | |
parameters = None, |
|||
input_state = None, |
|||
qubit_list = None |
|||
| ) |
Call to get the second Rényi entropy.
| parameters | A float64 numpy array |
| input_state | A complex array storing the input state. If None |0> is created. |
| qubit_list | A subset of qubits for which the Rényi entropy should be calculated. Returns with the calculated entropy |
Definition at line 288 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.Optimization_Problem | ( | self, | |
| parameters | |||
| ) |
Call to evaluate the VQE energy.
| parameters | A float64 numpy array. The number of parameters can be retrieved with method get_Parameter_Num |
Definition at line 271 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.Optimization_Problem_Grad | ( | self, | |
| parameters | |||
| ) |
Call to evaluate the VQE energy.
| parameters | A float64 numpy array. The number of parameters can be retrieved with method get_Parameter_Num |
Definition at line 278 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Ansatz | ( | self, | |
| ansatz_new | |||
| ) |
Call to set the ansatz type.
Currently imp
| ansatz_new | String of the ansatz . Possible values: "HEA" (hardware efficient ansatz with U3 and CNOT gates). |
Definition at line 256 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Density_Matrix_Noise | ( | self, | |
| density_noise | |||
| ) |
Configure ordered fixed local-noise insertions for the density backend.
| density_noise | A list of dictionaries with channel, target, after_gate_index, and noise value metadata. The supported required Phase 2 local-noise vocabulary is local_depolarizing, amplitude_damping, and phase_damping; depolarizing and dephasing are accepted aliases that normalize to the canonical local names. Phase 2 treats this as a mixed-state-only surface and rejects it on state_vector workflows. The supported positive path is the exact noisy HEA anchor workflow on the density_matrix backend. |
Definition at line 391 of file qgd_Variational_Quantum_Eigensolver_Base.py.

| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Gate_Structure | ( | self, | |
| Gate_structure | |||
| ) |
Call to set custom gate structure to used in the decomposition.
| Gate_structure | An instance of SQUANDER Circuit |
Definition at line 416 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Gate_Structure_from_Binary | ( | self, | |
| filename | |||
| ) |
Call to set custom layers to the gate structure that are intended to be used in the decomposition from a binary file created from SQUANDER.
| filename | String containing the filename |
Definition at line 248 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Initial_State | ( | self, | |
| initial_state | |||
| ) |
Call to get the number of free parameters in the gate structure used for the decomposition.
Definition at line 376 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Optimization_Tolerance | ( | self, | |
| tolerance | |||
| ) |
Definition at line 233 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Optimized_Parameters | ( | self, | |
| new_params | |||
| ) |
Call to set the parameters which are used as a starting point in the optimization.
| A | numpy array containing the parameters. The number of parameters can be retrieved with method get_Parameter_Num |
Definition at line 226 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Optimizer | ( | self, | |
| alg | |||
| ) |
Call to set the optimizer used in the VQE process.
| optimizer | String indicating the optimizer. Possible values: "BFGS" ,"ADAM", "BFGS2", "ADAM_BATCHED", "AGENTS", "COSINE", "AGENTS_COMBINED". |
Definition at line 204 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.set_Project_Name | ( | self, | |
| project_name | |||
| ) |
Call to set the name of the SQUANDER project.
| project_name_new | new project name |
Definition at line 241 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| def squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.Start_Optimization | ( | self | ) |
Call to start solving the VQE problem to get the approximation for the ground state.
Definition at line 210 of file qgd_Variational_Quantum_Eigensolver_Base.py.
|
private |
Definition at line 39 of file qgd_Variational_Quantum_Eigensolver_Base.py.
|
private |
Definition at line 38 of file qgd_Variational_Quantum_Eigensolver_Base.py.
|
private |
Definition at line 33 of file qgd_Variational_Quantum_Eigensolver_Base.py.
|
private |
Definition at line 37 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.backend |
Definition at line 196 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.density_noise |
Definition at line 197 of file qgd_Variational_Quantum_Eigensolver_Base.py.
| squander.VQA.qgd_Variational_Quantum_Eigensolver_Base.qbit_num |
Definition at line 192 of file qgd_Variational_Quantum_Eigensolver_Base.py.
1.8.13