-
Notifications
You must be signed in to change notification settings - Fork 15
tmp #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
tmp #232
Conversation
…instead of timesteps; refactor integrator functions for consistency
…ps; update system initialization parameters for consistency across tests.
… use N instead of T for consistency; update integrator functions accordingly.
…l problems - Changed control variable name from `a` to `u` across multiple problem templates: - `unitary_sampling_problem.jl` - `unitary_smooth_pulse_problem.jl` - `unitary_variational_problem.jl` - Updated associated bounds and regularization weights to reflect the new naming convention. - Enhanced trajectory initialization functions to support new control variable naming and added documentation for new methods. - Introduced new functions for generating initial unitary and control trajectories with detailed docstrings.
* update readme for docs building instructions * use new docs CI separate from rest * use PiccoloDocsTemplate * minor docs fixes --------- Co-authored-by: Gennadi Ryan <gennadiryan@gmail.com> Co-authored-by: Gennadi Ryan <41800392+gennadiryan@users.noreply.github.com>
* feat: add julia 1.12 to test matrix and update compat * chore: use 'pre' Julia version in nightly.yml
- Updated all manual pages and examples to use u, du, ddu naming - Changed .trajectory.a → .trajectory.u - Updated function parameters: a_bound → u_bound, da_bound → du_bound, etc. - Updated regularizers: R_a → R_u, R_da → R_du, R_dda → R_ddu - Updated math notation in index.md: a_t → u_t - Consistent with source code refactoring
- Created comprehensive comparison table of all 8 problem templates - Added selection guide for choosing the right template - Documented key differences: Unitary vs Ket, Smooth vs MinTime, etc. - Listed common parameters with examples - Updated make.jl to include overview as first manual page
- Created "Working with Solutions" guide covering: * Solving problems with solve!() options * Extracting controls, states, and time data * Fidelity evaluation (direct vs rollout) * Saving/loading trajectories * Post-processing and exporting for experiments * Best practices and debugging tips - Created "PiccoloOptions Reference" documenting: * All available options with examples * Common configuration patterns * Leakage suppression setup * When to use bound_state, geodesic, etc. * Tips and tricks for each option - Updated docs structure to include new manual pages
- Updated QuantumSystem constructors to include required T_max and drive_bounds - Updated VariationalQuantumSystem constructor with required parameters - Simplified solve!() calls (removed verbose and print_level to avoid issues) - Fixed all driftless_system instantiations in examples - Ensures all code blocks execute without UndefVarError or MethodError
- Added required T_max (10.0) and drive_bounds ([1.0, 1.0]) parameters - Updated all QuantumSystem calls with drift Hamiltonian - Fixed in: ket_problem_templates, unitary_problem_templates, working_with_solutions, and piccolo_options - Matches updated PiccoloQuantumObjects API signature
- Use EmbeddedOperator for matrix goals with QuantumSystem - Changed (system, matrix, T, Δt) → (system, EmbeddedOperator(matrix, system), T) - Removed Δt parameter (not used in current API, calculated from T and T_max) - Fixed in ket_problem_templates, unitary_problem_templates, working_with_solutions, and piccolo_options - Matches actual function signatures in problem templates
…jectory strategies
…riationalProblem examples
…moothPulseProblem examples for consistency
- Add unitary_trajectory(sys, U_goal, N) for unitary gate synthesis
- Takes goal unitary as positional arg, initial defaults to identity
- Supports geodesic interpolation and custom timestep bounds
- Add ket_trajectory(sys, ψ_init(s), ψ_goal(s), N) for quantum state transfer
- Supports single state or multiple states with shared controls
- Auto-generates state names (:ψ̃1, :ψ̃2) or accepts custom names
- Convenience constructor for single state: ket_trajectory(sys, ψ_init, ψ_goal, N)
- Add density_trajectory(sys, ρ_init, ρ_goal, N) for open system evolution
- Direct positional arguments for initial and goal density matrices
All functions:
- Accept Δt_min and Δt_max kwargs for timestep bounds
- Support free_time flag to toggle between variable/fixed timesteps
- Build NamedTrajectory directly without calling existing initialize_trajectory
- Properly convert sys.drive_bounds from Vector{Tuple} to (lower, upper) format
Added comprehensive tests for all functions including:
- Default parameters
- Fixed vs free time
- Custom timestep bounds
- Multiple states (for ket_trajectory)
- Custom state names
- Introduced the `QuantumTrajectories` module with three main trajectory types: `UnitaryTrajectory`, `KetTrajectory`, and `DensityTrajectory`. - Each trajectory type encapsulates quantum-specific metadata and provides high-level constructors for easy initialization. - Implemented accessor functions for trajectory properties and integrated with existing quantum systems. - Added tests for each trajectory type to ensure correct functionality and integration with quantum systems. - Created a new test suite for default integrators and smooth pulse problems, demonstrating the use of the new trajectory types.
- Implemented UnitaryMinimumTimeProblem for minimum-time unitary control optimization. - Developed UnitarySamplingProblem for robust control pulse generation across multiple quantum systems. - Created UnitarySmoothPulseProblem for free-time unitary gate problems with smooth control pulses. - Introduced UnitaryVariationalProblem for optimizing quantum control trajectories with variational parameters. - Added QuantumControlProblem wrapper to combine quantum trajectory information with optimization problems. - Included comprehensive documentation for each problem type and their respective arguments. - Implemented tests for various problem scenarios to ensure functionality and correctness. - Updated test_load.jl to verify the availability of new problem types in the QuantumCollocation module.
…jective type check in SmoothPulseProblem tests; add empty sampling_problem.jl file
…and Clarity - Updated SmoothPulseProblem to streamline control derivative handling and integrate new PiccoloQuantumObjects functions. - Improved integrator initialization logic to support both single and multiple integrators more intuitively. - Added support for SamplingTrajectory and EnsembleTrajectory in BilinearIntegrator, allowing for dynamic handling of multiple systems and state variables. - Introduced new KetInfidelityObjective variants to accommodate shared goals across multiple state variables in ensemble contexts. - Enhanced tests for various trajectory types, ensuring robust validation of integrator functionality and objective definitions.
jack-champagne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs are also fairly broken, will be fixing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the variational stuff being deleted?
|
|
||
| # Run all testitem tests in package | ||
| @run_package_tests | ||
| @run_package_tests filter=ti->( !(:experimental in ti.tags) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
marking the bilinear density integrator test as flaky and filtering it out here. opening an issue
…ing objectives for DensityTrajectory
…g the control problem
This pull request adds several new example scripts and updates existing ones to improve clarity, consistency, and usability for quantum optimal control problems using the QuantumCollocation.jl library. The most significant changes are the addition of new, well-documented examples for minimum time optimization, robust control, and single qubit gates, as well as refactoring and modernizing existing examples for multilevel transmon and two-qubit gates. These updates make the documentation more user-friendly and demonstrate advanced features and best practices.
New Example Additions:
minimum_time_problem.jlexample, demonstrating how to optimize for the fastest possible gate duration while maintaining high fidelity, including visualization and analysis of the tradeoff between fidelity and duration.robust_control.jlexample, showcasing robust pulse optimization usingUnitarySamplingProblemto handle system uncertainties and parameter variations, with detailed comparisons and visualization of results.single_qubit_gate.jlexample, providing a canonical step-by-step workflow for optimizing a Hadamard gate, including setup, solution, analysis, and suggestions for further exploration.Refactoring and Modernization of Existing Examples:
multilevel_transmon.jlto use consistent parameter naming (drive_bounds), removed unnecessary manual time step calculations, and switched to the modern API for problem setup and solution. Also improved code clarity and commented out legacy solution loading in favor of direct optimization calls. [1] [2] [3] [4]two_qubit_gates.jlto use new operator naming conventions, clarified Hamiltonian and control definitions, refactored system and problem setup to useEmbeddedOperatoranddrive_bounds, and commented out legacy solution loading. Also improved math notation for clarity. [1] [2] [3] [4] [5] [6]These changes greatly improve the accessibility and instructional value of the example scripts, making it easier for users to learn and apply advanced quantum control techniques.