Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
5687ebe
[fix] Replace removed np.complex/np.float aliases in IO.load_np_array
jie-qiqc Sep 2, 2026
3bb2bda
[fix] Round-trip multi-character single-qubit gate names in wrapped g…
jie-qiqc Sep 2, 2026
46ed7f8
[test] Force a non-interactive matplotlib backend for the test suite
jie-qiqc Sep 2, 2026
7392582
[fix] Fix broken absolute import in data_collection/user_interface.py
jie-qiqc Sep 2, 2026
63e39c0
[fix] Don't crash in get_node_by_labels/get_node_exclude_labels on an…
jie-qiqc Sep 2, 2026
d5dc56a
[fix] Fix non-trace-preserving multi-qubit amplitude damping noise
jie-qiqc Sep 2, 2026
b0b6b09
[fix] Fix two copy-paste bugs in metrics.py
jie-qiqc Sep 3, 2026
76447e9
[fix] Fix UnboundLocalError in Infidelity.evaluate for mixed stabiliz…
jie-qiqc Sep 3, 2026
b571da0
[fix] Register all compatible metric classes in Metrics._all
jie-qiqc Sep 3, 2026
db658e1
[fix] Fix ValueError compiling ClassicalCNOT/ClassicalCZ on a MixedSt…
jie-qiqc Sep 3, 2026
2e814f8
[fix] Stop OneQubitGateReplacement silently doing nothing on Stabilizer
jie-qiqc Sep 3, 2026
09febbd
[fix] Fix AttributeError compiling a noisy MeasurementZ on DensityMat…
jie-qiqc Sep 3, 2026
d8aa954
[fix] Fix AttributeError in RandomSearchSolver.update_hof for inf-sco…
jie-qiqc Sep 3, 2026
168375f
[fix] Fix AttributeError in EvolutionarySolver.update_logs when n_pop…
jie-qiqc Sep 4, 2026
b825e7e
[fix] Stop replace_photon_one_qubit_op labelling every new gate "Fixed"
jie-qiqc Sep 4, 2026
d7ad363
[fix] Validate pure input in density_to_stabilizer
jie-qiqc Sep 23, 2026
bdcfb76
[fix] Fix invalid/corrupting escape sequences in two docstrings
jie-qiqc Sep 23, 2026
3b40749
[fix] Refuse unsupported noise on a MixedStabilizer with NotImplement…
jie-qiqc Sep 23, 2026
1f634a4
[fix] Fix TypeError applying DepolarizingNoise to a pure Stabilizer
jie-qiqc Sep 23, 2026
28ca290
[fix] Fix AttributeError applying GeneralKrausError on DensityMatrix
jie-qiqc Sep 23, 2026
2e86792
[fix] Stop default-constructed ResetErrors sharing one noise_paramete…
jie-qiqc Sep 23, 2026
c6c5055
[fix] Return the density matrix from stabilizer_to_density for a mixture
jie-qiqc Sep 23, 2026
a0098b3
[fix] Fix eigenvector indexing in density_to_graph/density_to_stabilizer
jie-qiqc Sep 23, 2026
0f8c4be
[fix] Fall back to nx.random_labeled_tree where nx.random_tree is gone
jie-qiqc Sep 23, 2026
9135b33
[fix] Make trace_out_qubits discard the qubits it is given
jie-qiqc Sep 23, 2026
54b5a5a
[fix] Raise, rather than return, MixedStabilizer.tableau's TypeError
jie-qiqc Sep 23, 2026
af80827
[fix] Fix side effect and AttributeErrors in the stabilizer __eq__ me…
jie-qiqc Sep 23, 2026
ee3e1f9
[fix] Fix AttributeError and broadcast false-positive in DensityMatri…
jie-qiqc Sep 23, 2026
e6ef168
[fix] Fix the Pauli row scanners' loop bound and unknown-type fallback
jie-qiqc Sep 23, 2026
d1c3378
[fix] Reject a StabilizerTableau built from a non-square X/Z pair
jie-qiqc Sep 23, 2026
1b54bfc
[fix] Reject an unrecognised target basis in TimeReversedSolver._chan…
jie-qiqc Sep 23, 2026
ef79410
[fix] Return the added register's index from add_*_register
jie-qiqc Sep 23, 2026
5d37d89
[fix] Make OneQubitGateWrapper's nesting guard actually fire
jie-qiqc Sep 23, 2026
092892d
[fix] Fix CircuitDAG.to_json/from_json round trip
jie-qiqc Sep 23, 2026
0a9f663
[fix] Stop assign_noise mutating the circuit it copies
jie-qiqc Sep 23, 2026
f899dd6
[fix] Build a fresh settings object per solver instead of sharing one…
jie-qiqc Sep 23, 2026
f8ba137
[fix] Default AlternateTargetSolverSetting.lc_method to a dispatchabl…
jie-qiqc Sep 23, 2026
1fa6fdd
[fix] Report the seed a solver was given instead of always None
jie-qiqc Sep 23, 2026
809a3ca
[fix] Return state_to_graph's tuple in the documented order for matri…
jie-qiqc Sep 23, 2026
f8c2ee3
[fix] Fix converting a stabilizer QuantumState to the graph represent…
jie-qiqc Sep 23, 2026
8c965e3
[fix] Fix AttributeError formatting a MixedGraph as a string
jie-qiqc Sep 23, 2026
a20e5e5
[fix] Date the fallback folder name when IO.new_directory gets an emp…
jie-qiqc Sep 23, 2026
8ce498c
[fix] Fix two latent bugs in SolverResult
jie-qiqc Sep 23, 2026
29cc217
[fix] Fix broken src.* import in graph_states.crazy(alternate_order=T…
jie-qiqc Sep 23, 2026
9d0f3bb
[fix] Fix _select_graphs evicting the best-scoring candidate
jie-qiqc Sep 23, 2026
0b58dc6
[fix] Make the LC-equivalence demos run and report distinct graphs
jie-qiqc Sep 23, 2026
3926e4c
[fix] Make the solver benchmark and example_solve scripts use their s…
jie-qiqc Sep 23, 2026
1c60f09
[fix] Configure solvers through EvolutionarySolverSetting in tests an…
jie-qiqc Sep 23, 2026
bdc8fd6
[fix] Point the example notebooks at the graphiq package and renamed …
jie-qiqc Sep 23, 2026
332717f
[fix] Make the HTML visualization tutorial's figures render again
jie-qiqc Sep 23, 2026
865ff88
[fix] Fix docstrings and a type annotation in monte_carlo_noise.py
jie-qiqc Sep 23, 2026
84cbb13
[docs] Fix wrong and missing docstrings in noise_models.py
jie-qiqc Sep 23, 2026
b9e000e
[docs] Fix wrong and malformed docstrings in time_depend_noise.py and…
jie-qiqc Sep 23, 2026
4b2b427
[fix] Use math.factorial instead of the deprecated np.math alias
jie-qiqc Sep 23, 2026
b7385d1
[fix] Size binary_symplectic_product's form from the column count
jie-qiqc Sep 23, 2026
2de730a
[docs] Correct the g_function and row_sum docstrings in linalg.py
jie-qiqc Sep 23, 2026
2f8b9a0
[docs] Fix copy-pasted comments and a wrong return doc in metrics.py
jie-qiqc Sep 23, 2026
4ffeb5b
[docs] Correct the return docs of graph_to_stabilizer/_graph_to_stabi…
jie-qiqc Sep 23, 2026
374887c
[fix] Fix controlled-gate noise being dropped when the legs disagree …
jie-qiqc Sep 23, 2026
2341674
[fix] Raise on an unrecognised measurement_determinism in z_measureme…
jie-qiqc Sep 23, 2026
baa7dfb
[fix] Apply PauliError to a MixedStabilizer instead of raising TypeError
jie-qiqc Sep 23, 2026
31a6e89
[fix] Honour allow_relabel and allow_lc in AlternateTargetSolver
jie-qiqc Sep 23, 2026
4340ebd
[fix] Avoid NaN in DensityMatrix forced outcome-0 measurement
jie-qiqc Sep 23, 2026
69a8d14
[test] Pin noise-model failure modes on unsupported backends
jie-qiqc Sep 23, 2026
c2cb1a0
[fix] Make StabilizerTableau.validate work instead of raising
jie-qiqc Sep 23, 2026
9a351ce
[docs] Correct the GraphMetric and TraceDistance docstrings
jie-qiqc Sep 23, 2026
533bd71
[docs] Correct stale representation docs in state.py
jie-qiqc Sep 23, 2026
5a0fd8c
[docs] Fix wrong and missing parameter docs in the circuit classes
jie-qiqc Sep 23, 2026
9b3d025
[docs] Fix empty and copy-pasted docstrings in the stabilizer backend
jie-qiqc Sep 23, 2026
1e23949
[docs] Fix wrong return docs in the density-matrix and graph states
jie-qiqc Sep 23, 2026
1c10ee1
[docs] Correct solver docstrings that disagree with the code
jie-qiqc Sep 23, 2026
d21eb67
[docs] Fill in empty docstrings and fix field syntax in graphiq/utils
jie-qiqc Sep 23, 2026
a79c0b5
[docs] Correct return and parameter docs in benchmarks and visualizers
jie-qiqc Sep 23, 2026
04b2f0f
[fix] Record the metric's class name in benchmark_run's summary
jie-qiqc Sep 23, 2026
39d18eb
[test] Cover solver selection, probability adaptation and MC noise map
jie-qiqc Sep 23, 2026
2b0714e
[test] Cover QuantumState graph conversions and density-matrix helpers
jie-qiqc Sep 23, 2026
d6de2c7
[test] Cover parameter seeding, Monte Carlo noise draws and noise hel…
jie-qiqc Sep 23, 2026
69a9cd5
[test] Cover graph state generators, the graph backend API and LC checks
jie-qiqc Sep 23, 2026
e268d57
[test] Cover IO save/load round trips and SolverResult helpers
jie-qiqc Sep 23, 2026
06ccf78
[test] Cover the Clifford tableau's generator-string accessors
jie-qiqc Sep 23, 2026
858237a
[test] Add tests for the metrics module
jie-qiqc Sep 23, 2026
3dd4771
[fix] Contract each traced qubit in density-matrix partial_trace
jie-qiqc Sep 23, 2026
ff194c4
[fix] Read the phase vector when converting a stabilizer to a density…
jie-qiqc Sep 23, 2026
3e75bd4
[fix] Transfer the measurement sign when removing a stabilizer qubit
jie-qiqc Sep 23, 2026
ff2b80a
[fix] Forward measurement_determinism through QuantumState.partial_trace
jie-qiqc Sep 23, 2026
42d5a3b
[fix] Reset with X in reset_z instead of overwriting the measured row…
jie-qiqc Sep 23, 2026
a18d020
[fix] Leave the row signs in place in swap_gate
jie-qiqc Sep 23, 2026
b034771
[fix] Compute insert_qubit's np.insert indices against the original a…
jie-qiqc Sep 23, 2026
e4deaa9
[fix] Rotate back to the original frame after measure_x and measure_y
jie-qiqc Sep 23, 2026
3b4f9a9
[fix] Build a new tableau of the final size in tensor
jie-qiqc Sep 23, 2026
167e7ab
[fix] Make Stabilizer.apply_x_measurement work instead of raising
jie-qiqc Sep 23, 2026
f0f7d5f
[fix] Copy the whole row, sign included, on a Z-basis measurement
jie-qiqc Sep 23, 2026
6d874cd
[fix] Fold every matching tableau in MixedStabilizer.reduce
jie-qiqc Sep 23, 2026
d5d380e
[fix] Reject a stabilizer tableau with an i phase when converting to …
jie-qiqc Sep 23, 2026
55ebf54
[fix] Order height_dict's graph nodes by label
jie-qiqc Sep 23, 2026
6dd7f70
[fix] Make the evolutionary solver's candidate order independent of P…
jie-qiqc Sep 23, 2026
3c41561
[fix] Make _position_finder check every pivot of the X matrix
jie-qiqc Sep 23, 2026
42b9c87
[fix] Make inverse_circuit reduce every state; copy in clifford_from_…
jie-qiqc Sep 23, 2026
d27d95c
[fix] Check LC equivalence per connected component
jie-qiqc Sep 23, 2026
c731cfa
[test] Restore REDUCE_STABILIZER_MIXTURE after the tests that turn it…
jie-qiqc Sep 23, 2026
d2b9f6e
[fix] Reset the emitter in the density-matrix MeasurementCNOTandReset
jie-qiqc Sep 23, 2026
d1aca43
[fix] Apply additive noise on classically controlled operations
jie-qiqc Sep 23, 2026
3a951d1
[fix] Honour per-leg noise keys in SolverBase._identify_noise
jie-qiqc Sep 23, 2026
b7be7b0
[fix] Refuse replacement noise on MeasurementZ instead of mishandling it
jie-qiqc Sep 23, 2026
8976fc1
[docs] Fix the failing cells in the solvers startup notebook
jie-qiqc Sep 23, 2026
8015cd4
[test] Check solver winners in both measurement branches and reseed t…
jie-qiqc Sep 24, 2026
4630a86
[fix] Reject malformed stabilizer labels instead of misreading them
jie-qiqc Sep 24, 2026
2baadf1
[fix] Refuse partial_trace on a graph state built without an explicit…
jie-qiqc Sep 24, 2026
0cebd8e
[fix] Reject a malformed phase vector instead of zeroing or broadcast…
jie-qiqc Sep 24, 2026
f1b9df3
[fix] Stop AlternateTargetSolver.solve crashing when label_map is set
jie-qiqc Sep 24, 2026
9956e6a
[fix] Record the representation type when QuantumState detects it fro…
jie-qiqc Sep 24, 2026
283e7af
[fix] Return the figure and axes from Graph.draw so QuantumState.show…
jie-qiqc Sep 24, 2026
4ea9577
[fix] Return the axes draw_graph was given, and its figure, instead o…
jie-qiqc Sep 24, 2026
8df0e0d
[fix] Raise NotImplementedError from QuantumState.show on a mixed gra…
jie-qiqc Sep 24, 2026
9e8eb20
[docs] Say that assigning QuantumState.rep_type renames without conve…
jie-qiqc Sep 24, 2026
3bf3cac
[fix] Apply sort_emit and label_map on every iso_finder return path
jie-qiqc Sep 25, 2026
bd0ac5b
[fix] Keep name_to_class_map returning None for names outside its map…
jie-qiqc Sep 25, 2026
f539947
[fix] Drop the measurement_determinism parameter added to the partial…
jie-qiqc Sep 25, 2026
32df543
[fix] Keep "Fixed" on a photon gate that replaces a fixed one
jie-qiqc Sep 25, 2026
bb00f28
[fix] Reduce with the original Hadamard block first in inverse_circuit
jie-qiqc Sep 25, 2026
a74322c
[fix] Try pairwise basis sums before single vectors in the LC check
jie-qiqc Sep 25, 2026
c544171
[test] Pin that density_to_graph reads eigenvectors as columns
jie-qiqc Sep 25, 2026
806f801
[fix] Reject an unrecognised measurement_determinism before measuring
jie-qiqc Sep 25, 2026
6026aa7
[test] Cover the metric names Metrics registers and the GraphMetric e…
jie-qiqc Sep 25, 2026
43ee392
[fix] Count each one-qubit gate once in the data-collection unitary c…
jie-qiqc Sep 25, 2026
b6b3cc4
[test] Pin that a raise while applying split noise restores the gate'…
jie-qiqc Sep 25, 2026
63083a9
[docs] Correct false or stale comments, docstrings and a test name
jie-qiqc Sep 25, 2026
98c640a
[fix] Skip zero-weight eigenvectors when converting a mixed density m…
jie-qiqc Sep 25, 2026
4eeb602
[fix] Package only graphiq, not the tests, examples and visualization…
jie-qiqc Sep 25, 2026
7b86a24
[docs] Correct backend and state docstrings that disagree with the code
jie-qiqc Sep 25, 2026
b776113
[docs] Add missing docstrings to the backends and state modules
jie-qiqc Sep 25, 2026
2a7a9c5
[docs] Correct circuit, metric, noise and IO docstrings that disagree…
jie-qiqc Sep 25, 2026
45e3c7d
[docs] Add missing docstrings to the circuit, metric, noise and visua…
jie-qiqc Sep 25, 2026
0a92257
[docs] Correct solver, benchmark and utility docstrings that disagree…
jie-qiqc Sep 25, 2026
9bf01c1
[docs] Add missing docstrings to the solver, benchmark and utility mo…
jie-qiqc Sep 25, 2026
8751b63
[fix] Define rz with the three-parameter U gate in the OpenQASM output
jie-qiqc Sep 25, 2026
a5a6c43
[fix] Build find_lc_operations' complementations on the first graph, …
jie-qiqc Sep 25, 2026
a349830
[fix] Reject a list of (p, nx.Graph) in QuantumState.validate_data in…
jie-qiqc Sep 25, 2026
1cc80c7
[fix] Pair a OneQubitGateWrapper's noise with its gates in constructo…
jie-qiqc Sep 25, 2026
a3ada66
[perf] Fold mixed-stabilizer branches by the state they represent, no…
jie-qiqc Sep 25, 2026
c6e1090
[fix] Compare _compare_graphs_visual's labels with a list, so the che…
jie-qiqc Sep 26, 2026
d84039d
[fix] Share one noise lookup between the solvers and CircuitDAG.assig…
jie-qiqc Sep 26, 2026
579a1f4
[fix] Reject a graph with an isolated vertex in graph_to_circ instead…
jie-qiqc Sep 26, 2026
fcac0a3
[fix] Give a wrapper the section's OneQubitGateWrapper noise in assig…
jie-qiqc Sep 26, 2026
0281091
[fix] Keep a density matrix's photon-loss trace through measurement, …
jie-qiqc Sep 26, 2026
e203ea8
[fix] Let dmf.fidelity compare two mixed states: fix its range check …
jie-qiqc Sep 27, 2026
d086051
[packaging] Drop unused packages from requirements.txt and declare re…
jie-qiqc Sep 27, 2026
8e154ef
[packaging] Remove the trailing space from the Science/Research class…
jie-qiqc Sep 27, 2026
aafd402
[test] Leave the data-collection scripts out of coverage measurement
jie-qiqc Sep 27, 2026
1ea211c
[fix] Refuse to convert a mixed=False density matrix whose trace is n…
jie-qiqc Sep 27, 2026
301d4ca
[fix] Accept any generator set of a graph state in stabilizer_to_grap…
jie-qiqc Sep 27, 2026
b5c587e
[fix] Give the forced density-matrix measurement a rounding tolerance
jie-qiqc Sep 27, 2026
68de7ff
[fix] Let QuantumState convert a density matrix to a graph state
jie-qiqc Sep 27, 2026
333591b
[fix] Keep HybridEvolutionarySolver's density-matrix target when the …
jie-qiqc Sep 27, 2026
29061b1
[fix] Skip unfilled hall-of-fame slots when saving them as openQASM
jie-qiqc Sep 27, 2026
f48008e
[fix] Adapt only the transformations a solver allows in adapt_probabi…
jie-qiqc Sep 27, 2026
5c3e726
[fix] Let benchmark_data save its results and make the benchmark_util…
jie-qiqc Sep 27, 2026
6db9d35
[fix] Stop CompilerBase.compile from changing a pure stabilizer initi…
jie-qiqc Sep 27, 2026
a39556a
[fix] Deep-copy the initial state's data in CompilerBase.compile
jie-qiqc Sep 27, 2026
f62ac12
[fix] Apply a wrapper's gates last entry first in its openQASM body
jie-qiqc Sep 27, 2026
e6fbe02
[fix] Report the classical-bit index of a measurement in OpenQASMParser
jie-qiqc Sep 27, 2026
a84dd37
[fix] Store RX, RY and RZ default param_info in the per-parameter shape
jie-qiqc Sep 27, 2026
4c54d86
[fix] Let rnd_graph with an integer seed return a connected graph
jie-qiqc Sep 27, 2026
304f0ae
[fix] Let GraphCorr work without an initial graph
jie-qiqc Sep 27, 2026
957999d
[fix] Let GraphCorr use relabel_trials after graph_circ_dict
jie-qiqc Sep 27, 2026
7fe86f1
[fix] Update NodeCorr's adjacency matrix when its graph is set
jie-qiqc Sep 27, 2026
bc0ca07
[fix] Let find_best run without a dir_path and return its results
jie-qiqc Sep 27, 2026
971b9ad
[fix] Register the n_cnots property that rgs_analysis fills
jie-qiqc Sep 27, 2026
8578383
[fix] Create rgs_analysis's save directory before saving
jie-qiqc Sep 27, 2026
dc75888
[fix] Make plot_map_based take the result it plots
jie-qiqc Sep 27, 2026
b55651e
[fix] Read a photon control's own noise leg in photon_survival_rate
jie-qiqc Sep 27, 2026
e5e6596
[fix] Convert a graph state marked mixed to a density matrix
jie-qiqc Sep 27, 2026
12eb241
[fix] Let iso_graph_finder accept node labels other than 0..n-1
jie-qiqc Sep 27, 2026
cedf60e
[docs] State that local_comp_graph picks the node by position
jie-qiqc Sep 27, 2026
a4fad29
[test] Add regression tests for unfilled hall-of-fame slots
jie-qiqc Sep 27, 2026
44bac7a
[fix] Leave unfilled hall-of-fame slots out of the hof cost statistics
jie-qiqc Sep 27, 2026
71ec0f0
[fix] Tell control from target of classical pair ops when comparing
jie-qiqc Sep 27, 2026
c15101a
[fix] Give bipartite_partial_transpose the right shape for unequal dims
jie-qiqc Sep 27, 2026
3d13d6c
[fix] Take the global phase from the largest entry of the unitary
jie-qiqc Sep 27, 2026
4023de3
[fix] Let circuit.parameters set ops that are missing from the map
jie-qiqc Sep 27, 2026
95cbc14
[fix] Convert a mixed graph state holding a MixedGraph to a stabilizer
jie-qiqc Sep 27, 2026
b621f5b
[fix] Create LC_scaling_known's save directory before saving
jie-qiqc Sep 27, 2026
b3dae04
[fix] Draw an indexed measure or reset on its one qubit in Painter
jie-qiqc Sep 27, 2026
782610a
[docs] Say which LC helpers read node ids as positions
jie-qiqc Sep 27, 2026
9dfd7f3
[docs] Make the simulate_circuit notebook run on the current API
jie-qiqc Sep 27, 2026
857bd03
[test] Assert what twelve tests computed and discarded
jie-qiqc Sep 27, 2026
9614219
[fix] Import jax's config object, not the removed jax.config module
jie-qiqc Sep 27, 2026
0e53792
[fix] Reject an unsupported metric_weight when building Metrics
jie-qiqc Sep 27, 2026
9da87be
[fix] Close the file IO.load_txt reads
jie-qiqc Sep 27, 2026
de734c9
[fix] Draw on the axes CircuitDAG.draw_dag is given without a figure
jie-qiqc Sep 27, 2026
f5d33ff
[fix] Keep the caller's gate list intact in run_circuit(reverse=True)
jie-qiqc Sep 27, 2026
2962021
[fix] Make rref's rank check reject a single identity generator
jie-qiqc Sep 27, 2026
7457407
[fix] Keep HybridEvolutionarySolver's compiler noise-free without noise
jie-qiqc Sep 27, 2026
ef9cc47
[docs] Say what GraphCorr's relabel_trials and num_isomorph control
jie-qiqc Sep 27, 2026
3ad68c3
[fix] Divide GraphCorr's cnot_per_photon by the number of photons
jie-qiqc Sep 27, 2026
0555984
[fix] Compare graph_analyzer's worst fidelity against the worst so far
jie-qiqc Sep 27, 2026
b1626bd
[fix] Leave Input and Output out of graph_to_emit_depth's gate count
jie-qiqc Sep 27, 2026
9296f9f
[fix] Make benchmark_run save openQASM, as it asks for
jie-qiqc Sep 27, 2026
a10284a
[docs] Say what benchmark_data needs of its solver, targets and compiler
jie-qiqc Sep 27, 2026
5ad94b1
[fix] Give the emitter-depth metrics 0 on a circuit with no emitters
jie-qiqc Sep 27, 2026
f288ded
[fix] Centre density_matrix_bars' colour map on zero
jie-qiqc Sep 27, 2026
a49cfa6
[fix] Give result_maker's emitter depths and depth 0 without emitters
jie-qiqc Sep 27, 2026
1950949
[docs] Say where IO saves by default, and fix its usage example
jie-qiqc Sep 27, 2026
2fbbbc9
[fix] Reject None in GraphCorr's initial_graph setter
jie-qiqc Sep 27, 2026
30078da
[test] Drop test_one_benchmarking_run, which ran nothing
jie-qiqc Sep 27, 2026
5e67661
[fix] Draw on the figure CircuitDAG.draw_dag is given without an axes
jie-qiqc Sep 27, 2026
a662bfb
[fix] Ignore edge weights in local_comp_graph
jie-qiqc Sep 27, 2026
a662d17
[fix] Return the figure of the axes density_matrix_heatmap is given
jie-qiqc Sep 27, 2026
23199ad
[fix] Walk linear_partial_orbit's local complementations along the path
jie-qiqc Sep 27, 2026
168c44a
[style] Format metrics.py with black 24
jie-qiqc Sep 27, 2026
d162725
[test] Keep test_benchmark_run_graph_search_solver's output in tmp_path
jie-qiqc Sep 27, 2026
9dd9583
[fix] Derive QuantumState.n_qubits from its representation
jie-qiqc Sep 27, 2026
68c5957
[fix] Place crazy's alternate-order positions by the relabelling the …
jie-qiqc Sep 28, 2026
7193fc5
[fix] Reject an unknown criteria string in section_finder
jie-qiqc Sep 28, 2026
44fe525
[docs] Correct backend docstrings that contradict the code
jie-qiqc Sep 28, 2026
0016780
[docs] Correct circuit and openQASM docstrings that contradict the code
jie-qiqc Sep 28, 2026
aca2ffa
[docs] Correct noise, metrics and IO docstrings that contradict the code
jie-qiqc Sep 28, 2026
7c26a64
[docs] Correct solver and benchmark docstrings that contradict the code
jie-qiqc Sep 28, 2026
727dc22
[docs] Correct data-collection, relabelling and plotting docstrings t…
jie-qiqc Sep 28, 2026
8e527d3
[docs] Say where the solvers notebook's save_openqasm lives and what …
jie-qiqc Sep 28, 2026
0c3c886
[docs] Drop the saved traceback from the variational-circuits notebook
jie-qiqc Sep 28, 2026
d618a35
[docs] Say what does not work on the jax density-matrix path in this …
jie-qiqc Sep 28, 2026
5e9e73f
[fix] Stop _label_finder returning repeated permutations for small gr…
jie-qiqc Sep 28, 2026
cce2f07
[fix] Look up AlternateTargetSolver's relabel map by node label in no…
jie-qiqc Sep 28, 2026
65d4bbb
[update] Bump version to 0.1.2
jie-qiqc Sep 28, 2026
c64dfe5
[fix] Install only ray from the all extra in the Python 3.8 CI job
jie-qiqc Sep 28, 2026
df40b93
[test] Build the forced-measurement test's rounding-level state with …
jie-qiqc Sep 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
omit =
*/graphiq/data_collection/*
4 changes: 3 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
python -m pip install --upgrade pip
pip install flake8 pytest
pip install .
pip install .[all]
# optax needs jaxlib, which has no Python 3.8 wheels on PyPI any more,
# so on 3.8 only ray is installed from the "all" extra.
if [ "${{ matrix.python-version }}" = "3.8" ]; then pip install ray; else pip install .[all]; fi
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
13 changes: 7 additions & 6 deletions examples/example_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
import time

from graphiq.backends.density_matrix.compiler import DensityMatrixCompiler
from graphiq.solvers.evolutionary_solver import EvolutionarySolver
from graphiq.solvers.evolutionary_solver import (
EvolutionarySolver,
EvolutionarySolverSetting,
)
from graphiq.metrics import Infidelity

from graphiq.visualizers.density_matrix import density_matrix_bars
Expand All @@ -15,11 +18,8 @@


if __name__ == "__main__":
# %% here we have access
EvolutionarySolver.n_stop = 40
EvolutionarySolver.n_pop = 150
EvolutionarySolver.n_hof = 10
EvolutionarySolver.tournament_k = 10
# %% solver settings
setting = EvolutionarySolverSetting(n_stop=40, n_pop=150, n_hof=10, tournament_k=10)

# %% comment/uncomment for reproducibility
EvolutionarySolver.seed(3)
Expand All @@ -40,6 +40,7 @@
compiler=compiler,
n_photon=n_photon,
n_emitter=n_emitter,
solver_setting=setting,
)

# %% call the solver.solve() function to implement the random search algorithm
Expand Down
2 changes: 1 addition & 1 deletion examples/startup_guide/0_implementer_quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"3. Running a circuit (CompilerBase, DensityMatrixCompiler, StabilizerCompiler)\n",
"4. Noise models\n",
"5. Metrics (MetricBase, Infidelity, TraceDistance, Metrics)\n",
"6. Solvers (SolverBase, EvolutionarySolver, DeterministicSolver)\n",
"6. Solvers (SolverBase, EvolutionarySolver, TimeReversedSolver)\n",
"7. Benchmarking\n",
"8. (upcoming) Differentiable circuits\n",
"\n",
Expand Down
89 changes: 43 additions & 46 deletions examples/startup_guide/6_solvers.ipynb

Large diffs are not rendered by default.

37 changes: 7 additions & 30 deletions examples/startup_guide/8_variational_circuits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{
"cell_type": "markdown",
"source": [
"# Parameterized quantum circuits [Experimental]"
"# Parameterized quantum circuits [Experimental]\n",
"\n",
"**Not supported in this version.** This notebook does not run as written: setting `graphiq.DENSITY_MATRIX_ARRAY_LIBRARY` after `import graphiq` does not switch the density-matrix backend to `jax`; it keeps numpy. With `jax` selected (by editing `DENSITY_MATRIX_ARRAY_LIBRARY` in `graphiq/__init__.py`), no density-matrix `QuantumState` can be built from a matrix (`QuantumState` rejects jax arrays and `DensityMatrix` rejects numpy arrays), so the target below cannot be built, and the density-matrix arm of `Infidelity` cannot be differentiated. Its saved outputs come from an older version."
],
"metadata": {
"collapsed": false,
Expand Down Expand Up @@ -268,34 +270,8 @@
},
{
"cell_type": "code",
"execution_count": 9,
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" 0%| | 0/100 [00:00<?, ?it/s]\n"
]
},
{
"ename": "TracerArrayConversionError",
"evalue": "The numpy.ndarray conversion method __array__() was called on traced array with shape float32[].\nSee https://jax.readthedocs.io/en/latest/errors.html#jax.errors.TracerArrayConversionError",
"output_type": "error",
"traceback": [
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[0;31mTracerArrayConversionError\u001B[0m Traceback (most recent call last)",
"Cell \u001B[0;32mIn[9], line 4\u001B[0m\n\u001B[1;32m 2\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m step \u001B[38;5;129;01min\u001B[39;00m (pbar \u001B[38;5;241m:=\u001B[39m tqdm\u001B[38;5;241m.\u001B[39mtqdm(\u001B[38;5;28mrange\u001B[39m(n_step), disable\u001B[38;5;241m=\u001B[39m(\u001B[38;5;129;01mnot\u001B[39;00m progress))):\n\u001B[1;32m 3\u001B[0m loss \u001B[38;5;241m=\u001B[39m compute_loss(params, circuit)\n\u001B[0;32m----> 4\u001B[0m grads \u001B[38;5;241m=\u001B[39m \u001B[43mjax\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mgrad\u001B[49m\u001B[43m(\u001B[49m\u001B[43mcompute_loss\u001B[49m\u001B[43m)\u001B[49m\u001B[43m(\u001B[49m\u001B[43mparams\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcircuit\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 5\u001B[0m updates, opt_state \u001B[38;5;241m=\u001B[39m optimizer\u001B[38;5;241m.\u001B[39mupdate(grads, opt_state)\n\u001B[1;32m 6\u001B[0m params \u001B[38;5;241m=\u001B[39m optax\u001B[38;5;241m.\u001B[39mapply_updates(params, updates)\n",
" \u001B[0;31m[... skipping hidden 10 frame]\u001B[0m\n",
"Cell \u001B[0;32mIn[7], line 3\u001B[0m, in \u001B[0;36mcompute_loss\u001B[0;34m(params, circuit)\u001B[0m\n\u001B[1;32m 1\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mcompute_loss\u001B[39m(params: \u001B[38;5;28mdict\u001B[39m, circuit: CircuitDAG):\n\u001B[1;32m 2\u001B[0m circuit\u001B[38;5;241m.\u001B[39mparameters \u001B[38;5;241m=\u001B[39m params\n\u001B[0;32m----> 3\u001B[0m output_state \u001B[38;5;241m=\u001B[39m \u001B[43mcompiler\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcompile\u001B[49m\u001B[43m(\u001B[49m\u001B[43mcircuit\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 4\u001B[0m cost \u001B[38;5;241m=\u001B[39m metric\u001B[38;5;241m.\u001B[39mevaluate(output_state, circuit)\n\u001B[1;32m 5\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m cost\n",
"File \u001B[0;32m~/Library/CloudStorage/OneDrive-UniversityofWaterloo/Desktop/1 - Projects/AF Inverse Graph Design/graph-compiler/graphiq/backends/compiler_base.py:121\u001B[0m, in \u001B[0;36mCompilerBase.compile\u001B[0;34m(self, circuit, initial_state)\u001B[0m\n\u001B[1;32m 118\u001B[0m no_noise \u001B[38;5;241m=\u001B[39m no_noise \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(op\u001B[38;5;241m.\u001B[39mnoise, nm\u001B[38;5;241m.\u001B[39mNoNoise)\n\u001B[1;32m 120\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m no_noise:\n\u001B[0;32m--> 121\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcompile_one_gate\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 122\u001B[0m \u001B[43m \u001B[49m\u001B[43mstate\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mop\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcircuit\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mn_quantum\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mq_index\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mclassical_registers\u001B[49m\n\u001B[1;32m 123\u001B[0m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 125\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m 126\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_controlled_op:\n",
"File \u001B[0;32m~/Library/CloudStorage/OneDrive-UniversityofWaterloo/Desktop/1 - Projects/AF Inverse Graph Design/graph-compiler/graphiq/backends/density_matrix/compiler.py:86\u001B[0m, in \u001B[0;36mDensityMatrixCompiler.compile_one_gate\u001B[0;34m(self, state, op, n_quantum, q_index, classical_registers)\u001B[0m\n\u001B[1;32m 80\u001B[0m \u001B[38;5;28;01mpass\u001B[39;00m \u001B[38;5;66;03m# TODO: should think about best way to handle inputs/outputs\u001B[39;00m\n\u001B[1;32m 82\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(op, ops\u001B[38;5;241m.\u001B[39mOneQubitOperationBase):\n\u001B[1;32m 83\u001B[0m unitary \u001B[38;5;241m=\u001B[39m dm\u001B[38;5;241m.\u001B[39mget_one_qubit_gate(\n\u001B[1;32m 84\u001B[0m n_quantum,\n\u001B[1;32m 85\u001B[0m q_index(op\u001B[38;5;241m.\u001B[39mregister, op\u001B[38;5;241m.\u001B[39mreg_type),\n\u001B[0;32m---> 86\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mops\u001B[49m\u001B[43m[\u001B[49m\u001B[43mop\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[38;5;18;43m__class__\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mparams\u001B[49m\u001B[43m)\u001B[49m,\n\u001B[1;32m 87\u001B[0m )\n\u001B[1;32m 88\u001B[0m state\u001B[38;5;241m.\u001B[39mapply_unitary(unitary)\n\u001B[1;32m 90\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(op, ops\u001B[38;5;241m.\u001B[39mControlledPairOperationBase):\n",
"File \u001B[0;32m~/Library/CloudStorage/OneDrive-UniversityofWaterloo/Desktop/1 - Projects/AF Inverse Graph Design/graph-compiler/graphiq/backends/density_matrix/compiler.py:31\u001B[0m, in \u001B[0;36mDensityMatrixCompiler.<lambda>\u001B[0;34m(theta, phi, lam)\u001B[0m\n\u001B[1;32m 19\u001B[0m \u001B[38;5;66;03m# TODO: [longer term] refactor to take a QuantumState object input instead of creating its own initial state?\u001B[39;00m\n\u001B[1;32m 21\u001B[0m name \u001B[38;5;241m=\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mdm\u001B[39m\u001B[38;5;124m\"\u001B[39m\n\u001B[1;32m 22\u001B[0m ops \u001B[38;5;241m=\u001B[39m { \u001B[38;5;66;03m# the accepted operations and the single-qubit action needed for each gate\u001B[39;00m\n\u001B[1;32m 23\u001B[0m ops\u001B[38;5;241m.\u001B[39mInput: \u001B[38;5;28;01mlambda\u001B[39;00m: \u001B[38;5;28;01mNone\u001B[39;00m,\n\u001B[1;32m 24\u001B[0m ops\u001B[38;5;241m.\u001B[39mIdentity: \u001B[38;5;28;01mlambda\u001B[39;00m: \u001B[38;5;28;01mNone\u001B[39;00m,\n\u001B[1;32m 25\u001B[0m ops\u001B[38;5;241m.\u001B[39mPhase: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39mphase(),\n\u001B[1;32m 26\u001B[0m ops\u001B[38;5;241m.\u001B[39mPhaseDagger: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39mphase_dag(),\n\u001B[1;32m 27\u001B[0m ops\u001B[38;5;241m.\u001B[39mHadamard: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39mhadamard(),\n\u001B[1;32m 28\u001B[0m ops\u001B[38;5;241m.\u001B[39mSigmaX: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmax(),\n\u001B[1;32m 29\u001B[0m ops\u001B[38;5;241m.\u001B[39mSigmaY: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmay(),\n\u001B[1;32m 30\u001B[0m ops\u001B[38;5;241m.\u001B[39mSigmaZ: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmaz(),\n\u001B[0;32m---> 31\u001B[0m ops\u001B[38;5;241m.\u001B[39mParameterizedOneQubitRotation: \u001B[38;5;28;01mlambda\u001B[39;00m theta, phi, lam: \u001B[43mdm\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mparameterized_one_qubit_unitary\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 32\u001B[0m \u001B[43m \u001B[49m\u001B[43mtheta\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mphi\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mlam\u001B[49m\n\u001B[1;32m 33\u001B[0m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m,\n\u001B[1;32m 34\u001B[0m ops\u001B[38;5;241m.\u001B[39mParameterizedControlledRotationQubit: \u001B[38;5;28;01mlambda\u001B[39;00m theta, phi, lam: dm\u001B[38;5;241m.\u001B[39mparameterized_one_qubit_unitary(\n\u001B[1;32m 35\u001B[0m theta, phi, lam\n\u001B[1;32m 36\u001B[0m ),\n\u001B[1;32m 37\u001B[0m ops\u001B[38;5;241m.\u001B[39mCNOT: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmax(),\n\u001B[1;32m 38\u001B[0m ops\u001B[38;5;241m.\u001B[39mCZ: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmaz(),\n\u001B[1;32m 39\u001B[0m ops\u001B[38;5;241m.\u001B[39mClassicalCNOT: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmax(),\n\u001B[1;32m 40\u001B[0m ops\u001B[38;5;241m.\u001B[39mClassicalCZ: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmaz(),\n\u001B[1;32m 41\u001B[0m ops\u001B[38;5;241m.\u001B[39mMeasurementZ: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmaz(),\n\u001B[1;32m 42\u001B[0m ops\u001B[38;5;241m.\u001B[39mMeasurementCNOTandReset: \u001B[38;5;28;01mlambda\u001B[39;00m: dm\u001B[38;5;241m.\u001B[39msigmax(),\n\u001B[1;32m 43\u001B[0m ops\u001B[38;5;241m.\u001B[39mOutput: \u001B[38;5;28;01mlambda\u001B[39;00m: \u001B[38;5;28;01mNone\u001B[39;00m,\n\u001B[1;32m 44\u001B[0m }\n\u001B[1;32m 46\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21m__init__\u001B[39m(\u001B[38;5;28mself\u001B[39m, \u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs):\n\u001B[1;32m 47\u001B[0m \u001B[38;5;250m \u001B[39m\u001B[38;5;124;03m\"\"\"\u001B[39;00m\n\u001B[1;32m 48\u001B[0m \u001B[38;5;124;03m Create a compiler which acts on a DensityMatrix state representation\u001B[39;00m\n\u001B[1;32m 49\u001B[0m \n\u001B[1;32m 50\u001B[0m \u001B[38;5;124;03m :return: nothing\u001B[39;00m\n\u001B[1;32m 51\u001B[0m \u001B[38;5;124;03m :rtype: None\u001B[39;00m\n\u001B[1;32m 52\u001B[0m \u001B[38;5;124;03m \"\"\"\u001B[39;00m\n",
"File \u001B[0;32m~/Library/CloudStorage/OneDrive-UniversityofWaterloo/Desktop/1 - Projects/AF Inverse Graph Design/graph-compiler/graphiq/backends/density_matrix/functions.py:794\u001B[0m, in \u001B[0;36mparameterized_one_qubit_unitary\u001B[0;34m(theta, phi, lam)\u001B[0m\n\u001B[1;32m 775\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mparameterized_one_qubit_unitary\u001B[39m(theta, phi, lam):\n\u001B[1;32m 776\u001B[0m \u001B[38;5;250m \u001B[39m\u001B[38;5;124;03m\"\"\"\u001B[39;00m\n\u001B[1;32m 777\u001B[0m \u001B[38;5;124;03m Define a generic 3-parameter one-qubit unitary gate.\u001B[39;00m\n\u001B[1;32m 778\u001B[0m \n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 790\u001B[0m \u001B[38;5;124;03m :rtype: numpy.ndarray\u001B[39;00m\n\u001B[1;32m 791\u001B[0m \u001B[38;5;124;03m \"\"\"\u001B[39;00m\n\u001B[1;32m 792\u001B[0m gate \u001B[38;5;241m=\u001B[39m np\u001B[38;5;241m.\u001B[39marray(\n\u001B[1;32m 793\u001B[0m [\n\u001B[0;32m--> 794\u001B[0m [\u001B[43mnp\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcos\u001B[49m\u001B[43m(\u001B[49m\u001B[43mtheta\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m/\u001B[39;49m\u001B[43m \u001B[49m\u001B[38;5;241;43m2\u001B[39;49m\u001B[43m)\u001B[49m, \u001B[38;5;241m-\u001B[39mnp\u001B[38;5;241m.\u001B[39mexp(\u001B[38;5;241m1\u001B[39mj \u001B[38;5;241m*\u001B[39m lam) \u001B[38;5;241m*\u001B[39m np\u001B[38;5;241m.\u001B[39msin(theta \u001B[38;5;241m/\u001B[39m \u001B[38;5;241m2\u001B[39m)],\n\u001B[1;32m 795\u001B[0m [\n\u001B[1;32m 796\u001B[0m np\u001B[38;5;241m.\u001B[39mexp(\u001B[38;5;241m1\u001B[39mj \u001B[38;5;241m*\u001B[39m phi) \u001B[38;5;241m*\u001B[39m np\u001B[38;5;241m.\u001B[39msin(theta \u001B[38;5;241m/\u001B[39m \u001B[38;5;241m2\u001B[39m),\n\u001B[1;32m 797\u001B[0m np\u001B[38;5;241m.\u001B[39mexp(\u001B[38;5;241m1\u001B[39mj \u001B[38;5;241m*\u001B[39m (phi \u001B[38;5;241m+\u001B[39m lam)) \u001B[38;5;241m*\u001B[39m np\u001B[38;5;241m.\u001B[39mcos(theta \u001B[38;5;241m/\u001B[39m \u001B[38;5;241m2\u001B[39m),\n\u001B[1;32m 798\u001B[0m ],\n\u001B[1;32m 799\u001B[0m ]\n\u001B[1;32m 800\u001B[0m )\n\u001B[1;32m 801\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m gate\n",
"File \u001B[0;32m~/.virtualenvs/graph-compiler/lib/python3.9/site-packages/jax/_src/core.py:640\u001B[0m, in \u001B[0;36mTracer.__array__\u001B[0;34m(self, *args, **kw)\u001B[0m\n\u001B[1;32m 639\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21m__array__\u001B[39m(\u001B[38;5;28mself\u001B[39m, \u001B[38;5;241m*\u001B[39margs, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkw):\n\u001B[0;32m--> 640\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m TracerArrayConversionError(\u001B[38;5;28mself\u001B[39m)\n",
"\u001B[0;31mTracerArrayConversionError\u001B[0m: The numpy.ndarray conversion method __array__() was called on traced array with shape float32[].\nSee https://jax.readthedocs.io/en/latest/errors.html#jax.errors.TracerArrayConversionError"
]
}
],
"execution_count": null,
"outputs": [],
"source": [
"cost_curve = []\n",
"for step in (pbar := tqdm.tqdm(range(n_step), disable=(not progress))):\n",
Expand Down Expand Up @@ -391,7 +367,8 @@
"execution_count": 10,
"outputs": [],
"source": [
"from src.solvers.gradient_descent_solver import GradientDescentSolver, adagrad"
"from graphiq.solvers.gradient_descent_solver import GradientDescentSolver\n",
"from optax import adagrad"
],
"metadata": {
"collapsed": false,
Expand Down
Loading
Loading