@@ -409,6 +409,313 @@ mesher.getFdm1dMeshers() # underlying 1D meshers
409409
410410Helper for applying quanto adjustments in FDM pricing.
411411
412+ ## FDM Boundary Conditions
413+
414+ ### BoundaryConditionSide
415+
416+ ``` {eval-rst}
417+ .. autoclass:: pyquantlib.BoundaryConditionSide
418+ :members:
419+ :undoc-members:
420+ ```
421+
422+ Side of the domain for boundary conditions: ` None_ ` , ` Upper ` , ` Lower ` .
423+
424+ ### FdmBoundaryCondition
425+
426+ ``` {eval-rst}
427+ .. autoclass:: pyquantlib.FdmBoundaryCondition
428+ ```
429+
430+ Abstract boundary condition for FDM operators. Used in boundary condition sets passed to schemes.
431+
432+ ## FDM Operators
433+
434+ ### Building Block Operators
435+
436+ #### TripleBandLinearOp
437+
438+ ``` {eval-rst}
439+ .. autoclass:: pyquantlib.TripleBandLinearOp
440+ ```
441+
442+ Tridiagonal (triple-band) linear operator on one grid dimension.
443+
444+ ``` python
445+ mesher = ql.FdmMesherComposite(ql.Uniform1dMesher(0.0 , 1.0 , 10 ))
446+ op = ql.TripleBandLinearOp(0 , mesher)
447+
448+ result = op.apply(array)
449+ result = op.solve_splitting(rhs, a, b)
450+ op2 = op.mult(array)
451+ op3 = op.add(other_op)
452+ ```
453+
454+ #### FirstDerivativeOp
455+
456+ ``` {eval-rst}
457+ .. autoclass:: pyquantlib.FirstDerivativeOp
458+ ```
459+
460+ Central first-derivative operator (inherits from ` TripleBandLinearOp ` ).
461+
462+ ``` python
463+ d_dx = ql.FirstDerivativeOp(0 , mesher)
464+ gradient = d_dx.apply(values)
465+ ```
466+
467+ #### SecondDerivativeOp
468+
469+ ``` {eval-rst}
470+ .. autoclass:: pyquantlib.SecondDerivativeOp
471+ ```
472+
473+ Central second-derivative operator (inherits from ` TripleBandLinearOp ` ).
474+
475+ ``` python
476+ d2_dx2 = ql.SecondDerivativeOp(0 , mesher)
477+ laplacian = d2_dx2.apply(values)
478+ ```
479+
480+ #### NinePointLinearOp
481+
482+ ``` {eval-rst}
483+ .. autoclass:: pyquantlib.NinePointLinearOp
484+ ```
485+
486+ Nine-point cross-derivative operator on two grid dimensions.
487+
488+ #### SecondOrderMixedDerivativeOp
489+
490+ ``` {eval-rst}
491+ .. autoclass:: pyquantlib.SecondOrderMixedDerivativeOp
492+ ```
493+
494+ Second-order mixed partial derivative operator (inherits from ` NinePointLinearOp ` ).
495+
496+ ``` python
497+ d2_dxdy = ql.SecondOrderMixedDerivativeOp(0 , 1 , mesher)
498+ ```
499+
500+ ### Process Operators
501+
502+ Process-specific PDE operators, all inheriting from ` FdmLinearOpComposite ` . These encode the drift, diffusion, and cross terms for a given stochastic process. Constructed from a mesher and the corresponding process; the inherited methods (` size ` , ` setTime ` , ` apply ` , ` apply_mixed ` , ` apply_direction ` , ` solve_splitting ` , ` preconditioner ` ) are called internally by FDM schemes.
503+
504+ #### FdmBlackScholesOp
505+
506+ ``` {eval-rst}
507+ .. autoclass:: pyquantlib.FdmBlackScholesOp
508+ ```
509+
510+ Black-Scholes PDE operator.
511+
512+ ``` python
513+ op = ql.FdmBlackScholesOp(mesher, process, strike = 100.0 )
514+ ```
515+
516+ #### FdmBlackScholesFwdOp
517+
518+ ``` {eval-rst}
519+ .. autoclass:: pyquantlib.FdmBlackScholesFwdOp
520+ ```
521+
522+ Black-Scholes forward (Fokker-Planck) operator.
523+
524+ #### Fdm2dBlackScholesOp
525+
526+ ``` {eval-rst}
527+ .. autoclass:: pyquantlib.Fdm2dBlackScholesOp
528+ ```
529+
530+ Two-dimensional correlated Black-Scholes operator.
531+
532+ #### FdmHestonOp
533+
534+ ``` {eval-rst}
535+ .. autoclass:: pyquantlib.FdmHestonOp
536+ ```
537+
538+ Heston stochastic volatility PDE operator.
539+
540+ ``` python
541+ op = ql.FdmHestonOp(mesher, heston_process)
542+ ```
543+
544+ #### FdmHestonFwdOp
545+
546+ ``` {eval-rst}
547+ .. autoclass:: pyquantlib.FdmHestonFwdOp
548+ ```
549+
550+ Heston forward (Fokker-Planck) operator.
551+
552+ #### FdmHestonHullWhiteOp
553+
554+ ``` {eval-rst}
555+ .. autoclass:: pyquantlib.FdmHestonHullWhiteOp
556+ ```
557+
558+ Three-factor Heston plus Hull-White operator.
559+
560+ #### FdmBatesOp
561+
562+ ``` {eval-rst}
563+ .. autoclass:: pyquantlib.FdmBatesOp
564+ ```
565+
566+ Bates (Heston + jumps) PDE operator.
567+
568+ #### FdmHullWhiteOp
569+
570+ ``` {eval-rst}
571+ .. autoclass:: pyquantlib.FdmHullWhiteOp
572+ ```
573+
574+ Hull-White short-rate PDE operator.
575+
576+ #### FdmG2Op
577+
578+ ``` {eval-rst}
579+ .. autoclass:: pyquantlib.FdmG2Op
580+ ```
581+
582+ Two-factor Gaussian short-rate (G2) PDE operator.
583+
584+ #### FdmCEVOp
585+
586+ ``` {eval-rst}
587+ .. autoclass:: pyquantlib.FdmCEVOp
588+ ```
589+
590+ Constant Elasticity of Variance PDE operator.
591+
592+ #### FdmSabrOp
593+
594+ ``` {eval-rst}
595+ .. autoclass:: pyquantlib.FdmSabrOp
596+ ```
597+
598+ SABR stochastic volatility PDE operator.
599+
600+ #### FdmLocalVolFwdOp
601+
602+ ``` {eval-rst}
603+ .. autoclass:: pyquantlib.FdmLocalVolFwdOp
604+ ```
605+
606+ Local volatility forward (Fokker-Planck) operator.
607+
608+ #### FdmSquareRootFwdOp
609+
610+ ``` {eval-rst}
611+ .. autoclass:: pyquantlib.FdmSquareRootFwdOp
612+ ```
613+
614+ Square-root (CIR) forward operator, used in Heston SLV calibration.
615+
616+ #### FdmOrnsteinUhlenbeckOp
617+
618+ ``` {eval-rst}
619+ .. autoclass:: pyquantlib.FdmOrnsteinUhlenbeckOp
620+ ```
621+
622+ Ornstein-Uhlenbeck mean-reverting PDE operator.
623+
624+ ## FDM Schemes
625+
626+ Time-stepping schemes for evolving the PDE solution backward (or forward) in time. All schemes share the same interface:
627+
628+ ``` python
629+ scheme.setStep(dt) # set time step size
630+ array = scheme.step(array, t) # advance one step from time t
631+ ```
632+
633+ The ` step ` method returns the modified array (Python copy semantics).
634+
635+ ### ExplicitEulerScheme
636+
637+ ``` {eval-rst}
638+ .. autoclass:: pyquantlib.ExplicitEulerScheme
639+ ```
640+
641+ Forward Euler (explicit) time stepping.
642+
643+ ### ImplicitEulerScheme
644+
645+ ``` {eval-rst}
646+ .. autoclass:: pyquantlib.ImplicitEulerScheme
647+ ```
648+
649+ Backward Euler (implicit) time stepping with iterative solver.
650+
651+ ``` python
652+ scheme = ql.ImplicitEulerScheme(op, relTol = 1e-8 )
653+ scheme.numberOfIterations() # solver iterations from last step
654+ ```
655+
656+ #### ImplicitEulerSolverType
657+
658+ ``` {eval-rst}
659+ .. autoclass:: pyquantlib.ImplicitEulerSolverType
660+ :members:
661+ :undoc-members:
662+ ```
663+
664+ Iterative solver for implicit schemes: ` BiCGstab ` , ` GMRES ` .
665+
666+ ### CrankNicolsonScheme
667+
668+ ``` {eval-rst}
669+ .. autoclass:: pyquantlib.CrankNicolsonScheme
670+ ```
671+
672+ Crank-Nicolson (theta = 0.5) time stepping.
673+
674+ ``` python
675+ scheme = ql.CrankNicolsonScheme(0.5 , op)
676+ scheme.numberOfIterations()
677+ ```
678+
679+ ### DouglasScheme
680+
681+ ``` {eval-rst}
682+ .. autoclass:: pyquantlib.DouglasScheme
683+ ```
684+
685+ Douglas ADI time-stepping scheme.
686+
687+ ### CraigSneydScheme
688+
689+ ``` {eval-rst}
690+ .. autoclass:: pyquantlib.CraigSneydScheme
691+ ```
692+
693+ Craig-Sneyd ADI time-stepping scheme.
694+
695+ ### HundsdorferScheme
696+
697+ ``` {eval-rst}
698+ .. autoclass:: pyquantlib.HundsdorferScheme
699+ ```
700+
701+ Hundsdorfer ADI time-stepping scheme.
702+
703+ ### ModifiedCraigSneydScheme
704+
705+ ``` {eval-rst}
706+ .. autoclass:: pyquantlib.ModifiedCraigSneydScheme
707+ ```
708+
709+ Modified Craig-Sneyd ADI time-stepping scheme.
710+
711+ ### MethodOfLinesScheme
712+
713+ ``` {eval-rst}
714+ .. autoclass:: pyquantlib.MethodOfLinesScheme
715+ ```
716+
717+ Method of lines (Runge-Kutta) time-stepping scheme.
718+
412719``` {note}
413- Abstract base classes `BrownianGenerator`, `BrownianGeneratorFactory`, and `FdmMesher` are available in `pyquantlib.base` for type checking.
720+ Abstract base classes `FdmLinearOp`, `FdmLinearOpComposite`, ` BrownianGenerator`, `BrownianGeneratorFactory`, and `FdmMesher` are available in `pyquantlib.base` for type checking.
414721```
0 commit comments