torch.special.shifted_chebyshev_polynomial_u
function shifted_chebyshev_polynomial_u<S extends Shape>(x: Tensor<S, 'float32'>, n: number | Tensor, options?: SpecialPolynomialOptions<S>): Tensor<S, 'float32'>Computes shifted Chebyshev polynomial of the second kind U*_n(x).
The shifted second kind U*_n(x) = U_n(2x - 1) transforms the domain of the second kind polynomial from [-1, 1] to [0, 1]. Inherits the √(1-x²) weight structure but now applies to [0, 1] directly. Used for:
- Quantum mechanics on [0, 1]: angular momentum basis functions, radial wave functions
- Spectral methods with √(x(1-x)) weight: suited for problems with boundary singularities
- Function approximation where second-kind basis is preferred: derivative approximation, slope control
- Probability density functions: approximating weighted PDFs on [0, 1]
- Domain [0, 1]: Direct computation avoids manual domain mapping
- Weight √(x(1-x)): Natural on [0, 1]; transformed from √(1-u²) on [-1, 1]
- Boundary amplitude: Grows as n+1 at x=1; opposite sign at x=0
- Same recurrence: Efficient three-term recurrence like standard U_n
- Different from T*_n: Use when second-kind orthogonality structure is needed
- Boundary singularities: Weight function vanishes at endpoints; be careful numerically
Parameters
xTensor<S, 'float32'>- Input tensor with values in [0, 1]
nnumber | Tensor- Polynomial degree (non-negative integer). Can be scalar or Tensor
optionsSpecialPolynomialOptions<S>optional- Optional output tensor
Returns
Tensor<S, 'float32'>– Tensor with U*_n(x) valuesExamples
// Shifted second kind on [0, 1]
const x = torch.linspace(0, 1, 5);
const U_star_0 = torch.special.shifted_chebyshev_polynomial_u(x, 0); // [1, 1, 1, 1, 1]
const U_star_1 = torch.special.shifted_chebyshev_polynomial_u(x, 1); // 4*x - 2
const U_star_2 = torch.special.shifted_chebyshev_polynomial_u(x, 2); // 16*x^2 - 16*x + 2
// Quantum basis on [0, 1]
const r = torch.linspace(0, 1, 100); // Radial coordinate [0, 1]
const n_basis = 3;
const basis = torch.special.shifted_chebyshev_polynomial_u(r, n_basis);
// Natural basis for radial functions normalized to [0, 1]
// Boundary behavior comparison
const x_ends = torch.tensor([0.0, 1.0]);
const U_star_ends = torch.special.shifted_chebyshev_polynomial_u(x_ends, 5);
// U*_5(0) = -6, U*_5(1) = 6 (opposite signs at boundaries)See Also
- PyTorch torch.special.shifted_chebyshev_polynomial_u()
- torch.special.shifted_chebyshev_polynomial_t - Shifted first kind
- torch.special.chebyshev_polynomial_u - Standard second kind on [-1, 1]