MCPcopy Create free account

hub / github.com/PennyLaneAI/demos / functions

Functions1,425 in github.com/PennyLaneAI/demos

↓ 2 callersFunctionrun_estimate
(params, H)
demonstrations_v2/tutorial_classical_expval_estimation/demo.py:384
↓ 2 callersFunctionrun_iterations
(n_train)
demonstrations_v2/tutorial_learning_few_data/demo.py:461
↓ 2 callersFunctionrun_lightning
(params, H)
demonstrations_v2/tutorial_classical_expval_estimation/demo.py:394
↓ 2 callersFunctionrun_opt
(value_and_grad, theta, n_epochs=120, lr=0.1, b1=0.9, b2=0.999)
demonstrations_v2/tutorial_odegen/demo.py:271
↓ 2 callersFunctionrun_qpe
()
demonstrations_v2/tutorial_shors_algorithm_catalyst/demo.py:790
↓ 2 callersFunctionsample_random_states
Sample random states from the Haar measure.
demonstrations_v2/tutorial_rl_pulse/demo.py:316
↓ 2 callersFunctionsamples_dict
Just sorting the outputs in a dictionary
demonstrations_v2/tutorial_QUBO/demo.py:383
↓ 2 callersFunctionsel_circuit
(qubit_value)
demonstrations_v2/tutorial_lcu_blockencoding/demo.py:176
↓ 2 callersFunctionshadow_bound
Calculate the shadow bound for the Pauli measurement scheme. Implements Eq. (S13) from https://arxiv.org/pdf/2002.08953.pdf Args:
demonstrations_v2/tutorial_classical_shadows/demo.py:550
↓ 2 callersFunctionshadow_state_reconstruction
Reconstruct a state approximation as an average over all snapshots in the shadow. Args: shadow (tuple): A shadow tuple obtained from
demonstrations_v2/tutorial_classical_shadows/demo.py:322
↓ 2 callersFunctionshors_algorithm_no_qjit
(N, key, a, n_bits, n_trials)
demonstrations_v2/tutorial_shors_algorithm_catalyst/demo.py:972
↓ 2 callersFunctionsigmoid
(x)
demonstrations_v2/tutorial_vqt/demo.py:201
↓ 2 callersFunctionsigmoid
Sigmoid function with steepness parameter k.
demonstrations_v2/tutorial_optimal_control/demo.py:356
↓ 2 callersFunctionsigmoid_rectangle
Smooth-rectangle pulse between t_0 and t_1, with amplitude Omega.
demonstrations_v2/tutorial_optimal_control/demo.py:253
↓ 2 callersFunctionsplit
Split a matrix M via SVD and keep only the ``bond_dim`` largest entries.
demonstrations_v2/tutorial_mps/demo.py:310
↓ 2 callersFunctionspsr_circuit
(gate_pars, s=None, sign=+1)
demonstrations_v2/tutorial_stochastic_parameter_shift/demo.py:316
↓ 2 callersFunctionsquare_loss
(targets, predictions)
demonstrations_v2/tutorial_expressivity_fourier_series/demo.py:147
↓ 2 callersFunctionsquare_loss
(labels, predictions)
demonstrations_v2/tutorial_variational_classifier/demo.py:138
↓ 2 callersFunctionstate_preparation
(state)
demonstrations_v2/tutorial_teleportation/demo.py:131
↓ 2 callersFunctionstate_preparation
(x)
demonstrations_v2/tutorial_variational_classifier/demo.py:101
↓ 2 callersFunctionstochastic_parshift_grad
(theta, num_samples)
demonstrations_v2/tutorial_here_comes_the_sun/demo.py:281
↓ 2 callersFunctionswap_test
(params)
demonstrations_v2/tutorial_vqe_vqd/demo.py:121
↓ 2 callersFunctionsyndrome_circuit
(meas_ops, x_basis=False)
demonstrations_v2/tutorial_fault_tolerant_threshold/demo.py:226
↓ 2 callersFunctiontarget_alignment
Kernel-target alignment between kernel and labels.
demonstrations_v2/tutorial_kernels_module/demo.py:519
↓ 2 callersFunctiontarget_func
(x)
demonstrations_v2/tutorial_apply_qsvt/demo.py:231
↓ 2 callersFunctiontau_amplitudes
Computes the state amplitudes of tau in the computational basis.
demonstrations_v2/tutorial_quantum_chebyshev_transform/demo.py:309
↓ 2 callersFunctiontest_t_gadget
(init_state)
demonstrations_v2/tutorial_mcm_introduction/demo.py:384
↓ 2 callersFunctiontgate
(state)
demonstrations_v2/tutorial_trapped_ions/demo.py:475
↓ 2 callersFunctiontheta_Y
(x)
demonstrations_v2/tutorial_kak_decomposition/demo.py:627
↓ 2 callersFunctiontheta_Z
(x)
demonstrations_v2/tutorial_kak_decomposition/demo.py:609
↓ 2 callersFunctionthreshold_scan_acc_score
Given the anomaly scores and truth values, scan over a range of thresholds = [zeta_min, zeta_max] with a fixed number of steps, calculating th
demonstrations_v2/tutorial_univariate_qvr/demo.py:896
↓ 2 callersFunctiontrain_step
Single optimization step in the training procedure.
demonstrations_v2/learning2learn/demo.py:442
↓ 2 callersFunctiontrainable_layer
(weight, wires)
demonstrations_v2/tutorial_eqnn_force_field/demo.py:260
↓ 2 callersFunctiontraining_cost
(weights)
demonstrations_v2/tutorial_barren_gadgets/demo.py:295
↓ 2 callersFunctiontrajectory
(params, t)
demonstrations_v2/oqc_pulse/demo.py:114
↓ 2 callersFunctionupdate_step
Perform a single gradient update step
demonstrations_v2/tutorial_vqe_spin_sectors/demo.py:243
↓ 2 callersFunctionupdate_step
Perform a single gradient update step
demonstrations_v2/tutorial_chemical_reactions/demo.py:160
↓ 2 callersFunctionupdate_step
(params, opt_state)
demonstrations_v2/tutorial_qcbm/demo.py:303
↓ 2 callersFunctionupdate_step
(opt, params, opt_state, data, targets)
demonstrations_v2/tutorial_How_to_optimize_QML_model_using_JAX_and_Optax/demo.py:139
↓ 2 callersFunctionupdate_step
(i, args)
demonstrations_v2/tutorial_How_to_optimize_QML_model_using_JAX_catalyst_and_Optax/demo.py:134
↓ 2 callersFunctionvariational_block
Variational circuit mapping the ground state |0> to the ansatz state |x>.
demonstrations_v2/tutorial_coherent_vqls/demo.py:307
↓ 2 callersFunctionvariational_block
Variational circuit mapping the ground state |0> to the ansatz state |x>.
demonstrations_v2/tutorial_vqls/demo.py:255
↓ 2 callersFunctionvariational_classifier
(weights, bias, x)
demonstrations_v2/tutorial_post-variational_quantum_neural_networks/demo.py:235
↓ 1 callersFunctionA
Compute the tensor A in form of d=2 matrices with shape (D, D) = (2, 2) each.
demonstrations_v2/tutorial_constant_depth_mps_prep/demo.py:159
↓ 1 callersFunctionCA_all
Controlled application of all the unitary components A_l of the problem matrix A.
demonstrations_v2/tutorial_coherent_vqls/demo.py:269
↓ 1 callersFunctionCFIM
(weights, phi, gamma)
demonstrations_v2/tutorial_quantum_metrology/demo.py:205
↓ 1 callersFunctionCNOT_MBQC
(input_state)
demonstrations_v2/tutorial_mbqc/demo.py:458
↓ 1 callersFunctionCRX_ring
Apply a controlled RX on all wires in a ring pattern
demonstrations_v2/tutorial_vqt/demo.py:252
↓ 1 callersFunctionCU_cpy
()
demonstrations_v2/tutorial_testing_symmetry/demo.py:314
↓ 1 callersFunctionCU_sys
()
demonstrations_v2/tutorial_testing_symmetry/demo.py:308
↓ 1 callersFunctionD
Generates an n_qubit quantum circuit according to a k-local Walsh operator expansion. Here, k-local means that 1 <= k <= n of the n qubits can int
demonstrations_v2/tutorial_univariate_qvr/demo.py:442
↓ 1 callersFunctionDQI
Quantum circuit implementing the DQI algorithm to solve max-XORSAT.
demonstrations_v2/tutorial_dqi/demo.py:592
↓ 1 callersFunctionHHL_encoding
(b, hamiltonian_evolution, n, precision)
demonstrations_v2/linear_equations_hhl_qrisp_catalyst/demo.py:546
↓ 1 callersFunctionH_layer
Layer of single-qubit Hadamard gates.
demonstrations_v2/tutorial_quantum_transfer_learning/demo.py:273
↓ 1 callersFunctionJ_F
(probabilities)
demonstrations_v2/tutorial_classical_kernels/demo.py:570
↓ 1 callersFunctionK
(theta, k)
demonstrations_v2/tutorial_fixed_depth_hamiltonian_simulation_via_cartan_decomposition/demo.py:267
↓ 1 callersFunctionKnapsack
Create a docplex model of the problem. (Docplex is a classical solver from IBM)
demonstrations_v2/tutorial_QUBO/demo.py:544
↓ 1 callersFunctionMolmer_Sorensen
(t)
demonstrations_v2/tutorial_trapped_ions/demo.py:778
↓ 1 callersFunctionOracle
Defines the unitary that implements a function f:{0,..,15} -> {0,..,7}. Args: f (func): function to implement Returns: ndar
demonstrations_v2/tutorial_period_finding/demo.py:166
↓ 1 callersFunctionQK_2
(x1, x2, thetas, amplitudes)
demonstrations_v2/tutorial_classical_kernels/demo.py:426
↓ 1 callersFunctionQK_circuit
(x1, x2, thetas, amplitudes)
demonstrations_v2/tutorial_classical_kernels/demo.py:417
↓ 1 callersFunctionRX
(theta, input_state)
demonstrations_v2/tutorial_mbqc/demo.py:366
↓ 1 callersFunctionRX_MBQC
(theta, input_state)
demonstrations_v2/tutorial_mbqc/demo.py:381
↓ 1 callersFunctionRZ
(theta, input_state)
demonstrations_v2/tutorial_mbqc/demo.py:304
↓ 1 callersFunctionRZ_MBQC
(theta, input_state)
demonstrations_v2/tutorial_mbqc/demo.py:325
↓ 1 callersFunctionS
(x, thetas, wires)
demonstrations_v2/tutorial_classical_kernels/demo.py:326
↓ 1 callersFunctionS
(x)
demonstrations_v2/tutorial_qnn_multivariate_regression/demo.py:90
↓ 1 callersFunctionS2_exp_value
(params)
demonstrations_v2/tutorial_vqe_spin_sectors/demo.py:203
↓ 1 callersFunctionSPSRgates
(gate_pars, s, sign)
demonstrations_v2/tutorial_stochastic_parameter_shift/demo.py:304
↓ 1 callersFunctionShiftOp
(num_shifts, num_load_wires, wires)
demonstrations_v2/tutorial_resource_estimation_QSVT_CFD/demo.py:189
↓ 1 callersFunctionSum
(wires_subset, wires_sum)
demonstrations_v2/tutorial_intro_amplitude_amplification/demo.py:186
↓ 1 callersFunctionT0_state
()
demonstrations_v2/tutorial_magic_state_distillation/demo.py:253
↓ 1 callersFunctionU
(psi)
demonstrations_v2/linear_equations_hhl_qrisp_catalyst/demo.py:326
↓ 1 callersFunctionU_B
(beta)
demonstrations_v2/tutorial_qaoa_maxcut/demo.py:154
↓ 1 callersFunctionU_B_res
(n_wires, wires=None, epsilon=1e-5)
demonstrations_v2/tutorial_qaoa_maxcut/demo.py:308
↓ 1 callersFunctionU_C
(gamma)
demonstrations_v2/tutorial_qaoa_maxcut/demo.py:160
↓ 1 callersFunctionU_C_res
(n_edges, wires=None, epsilon=1e-5)
demonstrations_v2/tutorial_qaoa_maxcut/demo.py:311
↓ 1 callersFunctionU_b
Unitary matrix rotating the system ground state to the problem vector |b> = U_b |0>.
demonstrations_v2/tutorial_coherent_vqls/demo.py:283
↓ 1 callersFunctionU_c
Unitary matrix rotating the ground state of the ancillary qubits to |sqrt(c)> = U_c |0>.
demonstrations_v2/tutorial_coherent_vqls/demo.py:246
↓ 1 callersFunctionU_c_dagger
Adjoint of U_c.
demonstrations_v2/tutorial_coherent_vqls/demo.py:255
↓ 1 callersFunctionV_dagger_test
()
demonstrations_v2/tutorial_learningshallow/demo.py:193
↓ 1 callersFunctionV_sew
()
demonstrations_v2/tutorial_learningshallow/demo.py:385
↓ 1 callersFunctionWH_Diagonal_BE
(num_diagonals, matrix_size, num_walsh_coeffs)
demonstrations_v2/tutorial_resource_estimation_QSVT_CFD/demo.py:236
↓ 1 callersFunctionWalsh_Dk
(num_diags, size_diagonal, num_walsh_coeffs)
demonstrations_v2/tutorial_resource_estimation_QSVT_CFD/demo.py:143
↓ 1 callersFunctionZ_rotations
Circuit implementing the Z rotations of the Hamiltonian fragments.
demonstrations_v2/tutorial_xas/demo.py:437
↓ 1 callersMethod__apply_blocking
(self, cost, params_curr, params_next)
demonstrations_v2/qnspsa/demo.py:863
↓ 1 callersMethod__get_next_params
(self, params, gradient)
demonstrations_v2/qnspsa/demo.py:802
↓ 1 callersMethod__get_tensor_moving_avg
(self, metric_tensor)
demonstrations_v2/qnspsa/demo.py:852
↓ 1 callersMethod__get_tensor_tapes
(self, cost, params)
demonstrations_v2/qnspsa/demo.py:831
↓ 1 callersMethod__post_process_tensor
(self, tensor_raw_results, tensor_dirs)
demonstrations_v2/qnspsa/demo.py:781
↓ 1 callersMethod__regularize_tensor
(self, metric_tensor)
demonstrations_v2/qnspsa/demo.py:858
↓ 1 callersMethod__update_tensor
(self, tensor_raw)
demonstrations_v2/qnspsa/demo.py:825
↓ 1 callersFunction_ansatz
Parametrized quantum circuit ansatz that alternates arbitrary single-qubit rotations with strongly entangling CNOT layers. The depth of the ansatz
demonstrations_v2/tutorial_classical_expval_estimation/demo.py:95
↓ 1 callersFunction_build_demo
( ctx: Context, build_venv: Virtualenv, demo: Demo, target: BuildTarget, execute: bool,
lib/demo/lib/demo.py:272
↓ 1 callersFunction_c2v_update
Compute the next round of check‑to‑variable messages.
demonstrations_v2/tutorial_bp_catalyst/demo.py:470
↓ 1 callersFunction_collect_authors
Collect author information from user input.
lib/demo/app/app.py:161
↓ 1 callersFunction_create_demo_files
Create demo.py and metadata.json files.
lib/demo/app/app.py:189
↓ 1 callersFunction_decode
(syndrome: ArrayLike)
demonstrations_v2/tutorial_bp_catalyst/demo.py:247
↓ 1 callersFunction_find_sphinx_gallery_execution_error
Parse the error section from sphinx-gallery output. Returns `None` if the error section could not be found.
lib/demo/lib/demo.py:491
↓ 1 callersMethod_init
Initialize a virtual environment.
lib/demo/lib/virtual_env.py:26
← previousnext →501–600 of 1,425, ranked by callers