MCPcopy Create free account

hub / github.com/PennyLaneAI/demos / functions

Functions1,425 in github.com/PennyLaneAI/demos

↓ 3 callersFunctionget_accuracy_score
Given the predictions and truth values, return a number between 0 and 1 indicating the accuracy of predictions.
demonstrations_v2/tutorial_univariate_qvr/demo.py:880
↓ 3 callersFunctionget_angles
(x)
demonstrations_v2/tutorial_variational_classifier/demo.py:295
↓ 3 callersFunctionget_callable_projector_func
Using get_probs() above, take only the probability of measuring the bitstring of all zeroes (i.e, take the projector |0⟩^(⊗n)⟨0|^(⊗n)) on the
demonstrations_v2/tutorial_univariate_qvr/demo.py:522
↓ 3 callersFunctionget_initial_parameters
Randomly generate initial parameters. We need initial parameters for the variational circuit ansatz implementing W(alpha) and the standard deviati
demonstrations_v2/tutorial_univariate_qvr/demo.py:640
↓ 3 callersFunctionget_model_data
Computes the coefficients for the classical model, E^(A), E^(B), E^(C), and E^(D).
demonstrations_v2/tutorial_quantum_analytic_descent/demo.py:303
↓ 3 callersFunctionget_preds_given_threshold
For a given threshold, get the predicted labels (1 or -1), given the anomaly scores.
demonstrations_v2/tutorial_univariate_qvr/demo.py:862
↓ 3 callersFunctioninit_state
(x)
demonstrations_v2/tutorial_how_to_create_dynamic_mcm_circuits/demo.py:89
↓ 3 callersFunctionis_orthogonal
Check whether an operator is orthogonal to a space given by some basis.
demonstrations_v2/tutorial_kak_decomposition/demo.py:265
↓ 3 callersFunctionising_transition
Ising transition line
demonstrations_v2/tutorial_annni/demo.py:117
↓ 3 callersFunctionkt_transition
Kosterlitz-Thouless transition line
demonstrations_v2/tutorial_annni/demo.py:113
↓ 3 callersFunctionlayer0_subcircuit
This function contains all gates that precede parametrized layer 0
demonstrations_v2/tutorial_quantum_natural_gradient/demo.py:255
↓ 3 callersFunctionlayer1_subcircuit
This function contains all gates that precede parametrized layer 1
demonstrations_v2/tutorial_quantum_natural_gradient/demo.py:326
↓ 3 callersFunctionmeasure_x_stabilizers
Measure all X type stabilizers based on the parity check matrix X then apply Z type corrections from our decoder :param H: Parity check X mat
demonstrations_v2/tutorial_bp_catalyst/demo.py:752
↓ 3 callersFunctionmodel_circuit
(params, random_state)
demonstrations_v2/tutorial_learning_dynamics_incoherently/demo.py:169
↓ 3 callersFunctionnmr_resources
(time, one_norm, error)
demonstrations_v2/tutorial_estimator_hamiltonian_simulation_gqsp/demo.py:201
↓ 3 callersFunctionnon_identity_obs
(obs)
demonstrations_v2/tutorial_barren_gadgets/barren_gadgets/barren_gadgets.py:4
↓ 3 callersFunctionnon_identity_obs
(obs)
_static/demonstration_assets/barren_gadgets/barren_gadgets.py:4
↓ 3 callersFunctionoracle
(wires, omega)
demonstrations_v2/tutorial_grovers_algorithm/demo.py:172
↓ 3 callersFunctionoverlap_prob
Probability of measuring |0…0⟩ after U(x) U†(y).
demonstrations_v2/tutorial_huang_geometric_kernel_difference/demo.py:253
↓ 3 callersFunctionparallel_quantum_model
(weights, x)
demonstrations_v2/tutorial_expressivity_fourier_series/demo.py:531
↓ 3 callersFunctionparam_unitary
A bias-invariant unitary (U in the paper)
demonstrations_v2/tutorial_contextuality/demo.py:459
↓ 3 callersFunctionphoton_redirection
(params)
demonstrations_v2/plugins_hybrid/demo.py:168
↓ 3 callersFunctionplot_bloch_sphere
Helper function to plot vectors on a sphere.
demonstrations_v2/tutorial_haar_measure/demo.py:218
↓ 3 callersFunctionplot_points_prediction
(x, y, p, title)
demonstrations_v2/ensemble_multi_qpu/demo.py:488
↓ 3 callersFunctionpredict_spectrum
(probabilities)
demonstrations_v2/tutorial_classical_kernels/demo.py:532
↓ 3 callersFunctionprocess_text
Process a block of 'text'. Return a markdown text string representing the content.
lib/filter_helpers.py:31
↓ 3 callersFunctionqcnn_ansatz
Ansatz of the QCNN model Repetitions of the convolutional and pooling blocks until only 2 wires are left unmeasured
demonstrations_v2/tutorial_annni/demo.py:202
↓ 3 callersFunctionqec_round
One round of Steane code QEC with LUT decoding.
demonstrations_v2/tutorial_bp_catalyst/demo.py:925
↓ 3 callersFunctionqnode_finite
()
demonstrations_v2/tutorial_diffable_shadows/demo.py:219
↓ 3 callersFunctionquantum_neural_net
(var, x)
demonstrations_v2/quantum_neural_net/demo.py:77
↓ 3 callersFunctionrecurrent_loop
Creates the recurrent loop for the Recurrent Neural Network.
demonstrations_v2/learning2learn/demo.py:368
↓ 3 callersFunctionrotation_circuit
(theta)
demonstrations_v2/tutorial_stochastic_parameter_shift/demo.py:132
↓ 3 callersFunctionserial_quantum_model
(weights, x)
demonstrations_v2/tutorial_expressivity_fourier_series/demo.py:290
↓ 3 callersFunctionsigmoid
(x)
demonstrations_v2/tutorial_noisy_circuits/demo.py:246
↓ 3 callersFunctionstate_vector_to_dict
Convert a state vector into {bitstring: amplitude | probability}.
demonstrations_v2/tutorial_bp_catalyst/demo.py:799
↓ 3 callersFunctionsum_pytrees
Sum a list of pytrees.
demonstrations_v2/tutorial_rl_pulse/demo.py:529
↓ 3 callersFunctionsum_weight
(bitstring, items_weight)
demonstrations_v2/tutorial_QUBO/demo.py:76
↓ 3 callersFunctionswap_rot
bias-invariant unitary with swap matrix as generator
demonstrations_v2/tutorial_contextuality/demo.py:450
↓ 3 callersFunctionsyndrome_measurement
(error_wire)
demonstrations_v2/tutorial_stabilizer_codes/demo.py:149
↓ 3 callersFunctiontime_to_solution
n (int): number of variables time_single_case (float): time to solve a single case
demonstrations_v2/tutorial_QUBO/demo.py:125
↓ 3 callersFunctionvariational_classifier
(q_circuit, params, feat)
demonstrations_v2/tutorial_multiclass_classification/demo.py:127
↓ 2 callersFunctionB_T_multiplication
Computes B^T y into the syndrome register.
demonstrations_v2/tutorial_dqi/demo.py:467
↓ 2 callersFunctionCA
Controlled versions of the unitary components A_l of the problem matrix A.
demonstrations_v2/tutorial_vqls/demo.py:224
↓ 2 callersFunctionCNOT
(input_state)
demonstrations_v2/tutorial_mbqc/demo.py:446
↓ 2 callersFunctionCNOT_ladder
()
demonstrations_v2/tutorial_quantum_chebyshev_transform/demo.py:168
↓ 2 callersFunctionCNOT_ring
Apply CNOTs in a ring pattern
demonstrations_v2/tutorial_backprop/demo.py:71
↓ 2 callersFunctionF
Take the classical expectation value of of the projector on zero sampling the parameters of D from normal distributions. The expectation value is
demonstrations_v2/tutorial_univariate_qvr/demo.py:542
↓ 2 callersFunctionGauss_p
(x, L=np.pi)
demonstrations_v2/tutorial_classical_kernels/demo.py:204
↓ 2 callersFunctionGenerator
(theta1, theta2, theta3)
demonstrations_v2/tutorial_stochastic_parameter_shift/demo.py:287
↓ 2 callersFunctionH
(x)
demonstrations_v2/tutorial_mol_geo_opt/demo.py:129
↓ 2 callersFunctionIsingGenerators
(n, bc="open")
demonstrations_v2/tutorial_liealgebra/demo.py:275
↓ 2 callersFunctionMoment_step
(ops, dla)
demonstrations_v2/tutorial_liesim_extension/demo.py:364
↓ 2 callersFunctionMyModel
Initializes and returns a custom Keras model which is ready to be trained.
demonstrations_v2/tutorial_quanvolution/demo.py:288
↓ 2 callersFunctionPGD
(model, feats, labels, epsilon=0.1, alpha=0.01, num_iter=10)
demonstrations_v2/tutorial_adversarial_attacks_QML/demo.py:320
↓ 2 callersFunctionQChT
Performs the quantum Chebyshev transform.
demonstrations_v2/tutorial_quantum_chebyshev_transform/demo.py:239
↓ 2 callersFunctionQK
(delta, thetas, amplitudes)
demonstrations_v2/tutorial_classical_kernels/demo.py:434
↓ 2 callersFunctionQK_on_dataset
(deltas, thetas, amplitudes)
demonstrations_v2/tutorial_classical_kernels/demo.py:437
↓ 2 callersFunctionRGen
(param, generator, wires)
demonstrations_v2/tutorial_rotoselect/demo.py:317
↓ 2 callersFunctionRY_layer
Layer of parametrized qubit rotations around the y axis.
demonstrations_v2/tutorial_quantum_transfer_learning/demo.py:280
↓ 2 callersFunctionSCS
Implements the Split & Cycle shift unitary.
demonstrations_v2/tutorial_dqi/demo.py:310
↓ 2 callersFunctionSc_X_rot
(state, phi)
demonstrations_v2/tutorial_sc_qubits/demo.py:516
↓ 2 callersFunctionSc_Y_rot
(state, phi)
demonstrations_v2/tutorial_sc_qubits/demo.py:527
↓ 2 callersFunctionTFIM
(n)
demonstrations_v2/tutorial_liesim_extension/demo.py:97
↓ 2 callersFunctionU
(wires)
demonstrations_v2/tutorial_qpe/demo.py:213
↓ 2 callersFunctionUA
(thetas, control_wires, ancilla)
demonstrations_v2/tutorial_block_encoding/demo.py:130
↓ 2 callersFunctionUB
(wires_i, wires_j)
demonstrations_v2/tutorial_block_encoding/demo.py:136
↓ 2 callersFunctionU_b
Unitary matrix rotating the ground state to the problem vector |b> = U_b |0>.
demonstrations_v2/tutorial_vqls/demo.py:219
↓ 2 callersFunctionU_rotations
Circuit implementing the basis rotations of the Hamiltonian fragments.
demonstrations_v2/tutorial_xas/demo.py:412
↓ 2 callersFunctionU_target
(wires)
demonstrations_v2/tutorial_learningshallow/demo.py:267
↓ 2 callersFunctionV_i
(params, wires)
demonstrations_v2/tutorial_learningshallow/demo.py:284
↓ 2 callersFunctionW
(features, wires)
demonstrations_v2/tutorial_classical_kernels/demo.py:353
↓ 2 callersFunctionW
(params)
demonstrations_v2/tutorial_qnn_multivariate_regression/demo.py:96
↓ 2 callersMethod__get_spsa_grad_tapes
(self, cost, params)
demonstrations_v2/qnspsa/demo.py:816
↓ 2 callersMethod__init__
Args: csv_file (string): Path to the csv file with annotations. root_dir (string): Directory with all the images.
demonstrations_v2/tutorial_quantum_gans/demo.py:169
↓ 2 callersMethod__post_process_grad
(self, grad_raw_results, grad_dir)
demonstrations_v2/qnspsa/demo.py:773
↓ 2 callersMethod__step_core
(self, cost, params)
demonstrations_v2/qnspsa/demo.py:746
↓ 2 callersMethod__step_core_first_order
(self, cost, params)
demonstrations_v2/qnspsa/demo.py:762
↓ 2 callersFunction_author_format
Format author information as a dictionary.
lib/demo/app/app.py:156
↓ 2 callersFunction_build_graph
Pre‑compute variable‑node and check‑node neighbors. Returns ------- var_neighbors : tuple[tuple[int, ...], ...] # length = n ch
demonstrations_v2/tutorial_bp_catalyst/demo.py:408
↓ 2 callersMethod_init_data
Load all of the iterator into a list.
demonstrations_v2/tutorial_univariate_qvr/demo.py:383
↓ 2 callersFunction_load_inventory_from_path
Load an inventory from a local file. Returns None if file missing or invalid.
lib/inventories.py:20
↓ 2 callersFunction_load_inventory_from_url
Download objects.inv from URL and load with retry logic. Returns (inventory, raw_bytes).
lib/inventories.py:30
↓ 2 callersFunction_make_circular_data
Generate datapoints arranged in an even circle.
demonstrations_v2/tutorial_kernels_module/demo.py:143
↓ 2 callersFunction_make_named_inventory
Build a name -> item dict for easy lookup of inventory items.
lib/inventories.py:49
↓ 2 callersFunctionacc
(params, X, Y)
demonstrations_v2/tutorial_post-variational_quantum_neural_networks/demo.py:254
↓ 2 callersFunctionaccuracy
(classifier, X, Y_target)
demonstrations_v2/tutorial_kernels_module/demo.py:385
↓ 2 callersFunctionaccuracy
(labels, predictions)
demonstrations_v2/tutorial_adversarial_attacks_QML/demo.py:232
↓ 2 callersFunctionaccuracy
(p, x_val, y_val)
demonstrations_v2/tutorial_geometric_qml/demo.py:711
↓ 2 callersFunctionaccuracy
(labels, hard_predictions)
demonstrations_v2/tutorial_multiclass_classification/demo.py:206
↓ 2 callersFunctionaccuracy_no_sym
(p, x_val, y_val)
demonstrations_v2/tutorial_geometric_qml/demo.py:785
↓ 2 callersFunctionadapt_shape
Adapts the shape of an array to match the reference (either a batched vector or matrix). Example: >>> a = jnp.ones(3) >>> b = jnp.ones((3,
demonstrations_v2/tutorial_rl_pulse/demo.py:535
↓ 2 callersFunctionafter
()
demonstrations_v2/tutorial_mcm_introduction/demo.py:168
↓ 2 callersFunctionamp
(nu)
demonstrations_v2/oqc_pulse/demo.py:99
↓ 2 callersFunctionansatz
(theta, wires)
demonstrations_v2/tutorial_vqe_vqd/demo.py:105
↓ 2 callersFunctionansatz
(beta, **kwargs)
demonstrations_v2/tutorial_falqon/demo.py:244
↓ 2 callersFunctionansatz
(params)
demonstrations_v2/tutorial_rotoselect/demo.py:149
↓ 2 callersFunctionansatz_rsel
(params, generators)
demonstrations_v2/tutorial_rotoselect/demo.py:326
↓ 2 callersFunctionapply_gate
Apply the unitary matrix of the gate to a batch of states.
demonstrations_v2/tutorial_rl_pulse/demo.py:334
↓ 2 callersFunctionapply_gaussian_pivot
(mat: np.ndarray)
demonstrations_v2/tutorial_qldpc_codes/demo.py:371
↓ 2 callersFunctionaux_circuit
(theta, tau, sign)
demonstrations_v2/tutorial_here_comes_the_sun/demo.py:273
← previousnext →201–300 of 1,425, ranked by callers