Wigner D--矩阵

Wigner D-矩阵

在计算球面卷积(spherical CNN)的时候,对图像和卷积核进行傅里叶变换,然后通过矩阵相乘和傅里叶逆变换,来进行卷积。其中,图像就是球面图像,第一层卷积网络的卷积核是在s2球面上卷积,从第二层开始后面的卷积核都是在SO(3)群上的卷积。
Wigner D 矩阵是SU(2)和SO(3)群的不可约表示中的酉矩阵。它由尤金·维格纳 (Eugene Wigner)于 1927 年提出,在角动量的量子力学理论中起着基础性作用。D 矩阵的复共轭是球形和对称刚性转子的哈密顿量的特征函数。Wigner D-矩阵就是卷积过程中SO(3)群的基底,相当于基础的傅里叶变换中的sin 和cos。

基础知识

若我们把球谐函数 Y l , m ( r ^ ) Y_{l, m}(\hat{\mathbf{r}}) Yl,m(r^)绕原点进行某种旋转,得到的函数可以表示成球谐函数的线性组合,且只需要同一个 l l l子空间中的球谐函数,若将旋转算符(主动)记为 R R R,则
R ∣ l , m ⟩ = ∑ m ′ ∣ l , m ′ ⟩ ⟨ l , m ′ ∣ R ∣ l , m ⟩ \mathcal{R}|l, m\rangle=\sum_{m^{\prime}}\left|l, m^{\prime}\right\rangle\left\langle l, m^{\prime}|\mathcal{R}| l, m\right\rangle Rl,m=ml,ml,mRl,m

我们把系数矩阵称为 Wigner D 矩阵
D m ′ , m l = ⟨ l , m ′ ∣ R ∣ l , m ⟩ . D_{m^{\prime}, m}^l=\left\langle l, m^{\prime}|\mathcal{R}| l, m\right\rangle . Dm,ml=l,mRl,m.

代码

e3nn

def change_basis_real_to_complex(l: int, dtype=None, device=None) -> torch.Tensor:
    # https://en.wikipedia.org/wiki/Spherical_harmonics#Real_form
    q = torch.zeros((2 * l + 1, 2 * l + 1), dtype=torch.complex128)
    for m in range(-l, 0):
        q[l + m, l + abs(m)] = 1 / 2**0.5
        q[l + m, l - abs(m)] = -1j / 2**0.5
    q[l, l] = 1
    for m in range(1, l + 1):
        q[l + m, l + abs(m)] = (-1) ** m / 2**0.5
        q[l + m, l - abs(m)] = 1j * (-1) ** m / 2**0.5
    q = (-1j) ** l * q  # Added factor of 1j**l to make the Clebsch-Gordan coefficients real

    dtype, device = explicit_default_types(dtype, device)
    dtype = {
        torch.float32: torch.complex64,
        torch.float64: torch.complex128,
    }[dtype]
    # make sure we always get:
    # 1. a copy so mutation doesn't ruin the stored tensors
    # 2. a contiguous tensor, regardless of what transpositions happened above
    return q.to(dtype=dtype, device=device, copy=True, memory_format=torch.contiguous_format)
def su2_generators(j) -> torch.Tensor:
    m = torch.arange(-j, j)
    raising = torch.diag(-torch.sqrt(j * (j + 1) - m * (m + 1)), diagonal=-1)

    m = torch.arange(-j + 1, j + 1)
    lowering = torch.diag(torch.sqrt(j * (j + 1) - m * (m - 1)), diagonal=1)

    m = torch.arange(-j, j + 1)
    return torch.stack(
        [
            0.5 * (raising + lowering),  # x (usually)
            torch.diag(1j * m),  # z (usually)
            -0.5j * (raising - lowering),  # -y (usually)
        ],
        dim=0,
    )
def so3_generators(l) -> torch.Tensor:
    X = su2_generators(l)
    Q = change_basis_real_to_complex(l)
    X = torch.conj(Q.T) @ X @ Q
    assert torch.all(torch.abs(torch.imag(X)) < 1e-5)
    return torch.real(X)
def wigner_D(l, alpha, beta, gamma):
    alpha, beta, gamma = torch.broadcast_tensors(alpha, beta, gamma)
    alpha = alpha[..., None, None] % (2 * math.pi)
    beta = beta[..., None, None] % (2 * math.pi)
    gamma = gamma[..., None, None] % (2 * math.pi)
    X = so3_generators(l)
    return torch.matrix_exp(alpha * X[1]) @ torch.matrix_exp(beta * X[0]) @ torch.matrix_exp(gamma * X[1])



### 平滑伪Wigner-Ville分布公式的推导与解释 #### 定义平滑概念 平滑伪Wigner-Ville分布(Smoothed Pseudo Wigner-Ville Distribution, SPWVD)是对原始Wigner-Ville分布的一种改进版本,旨在减少交叉项的影响并提高时间-频率表示的质量。SPWVD通过对自相关函数应用窗函数来实现这一点。 #### 数学表达式 设 \( x(t) \) 是待分析的时间序列,则标准的Wigner-Ville分布在时间频率上的定义如下: \[ W_x(\tau,\omega)=\int_{-\infty}^{+\infty}{x^*(t+\frac{\tau }{2})x(t-\frac{\tau }{2})e^{-j\omega t}}dt \] 为了构建SPWVD,在上述公式的基础上加入一个窗口函数\( g(\cdot) \),得到新的形式: \[ S_x(\tau ,f)=\iint {g(u)x^*\left( t-u/2 \right) x\left( t+u/2 \right)} e^{-j2\pi fu}\ du\ dt \] 其中, - \( f=\omega / (2\pi ) \), - \( u \) 表示延迟变量, - \( g(u) \) 为加权因子或称为平滑窗口. 这种变换有效地降低了由线性组合引起的虚假分量,并增强了实际存在的瞬态特征的表现力[^1]. 对于具体的编程实现方面,可以采用离散化的方法计算SPWVD矩阵。下面给出Python代码片段用于展示如何基于numpy库快速创建这样的分布图谱。 ```python import numpy as np from scipy.signal import get_window def spwvd(x, fs=1.0, window=&#39;hann&#39;, nperseg=None): """ Compute the Smoothed Pseudo Wigner Ville Distribution. Parameters: x : array_like Time series of measurement values. fs : float, optional Sampling frequency of `x`. window : str or tuple or array_like, optional Desired window to use. nperseg : int, optional Length of each segment. Returns: wvd_matrix : ndarray The smoothed pseudo Wigner-Ville distribution matrix. """ if not isinstance(window, (str, tuple)): win = window else: win = get_window(window, nperseg) N = len(x) tau_max = min(nperseg//2, N//2) freqs = np.fft.fftfreq(N, d=1/fs)[:N//2] times = range(-tau_max, tau_max+1) wvd_matrix = np.zeros((len(freqs), len(times)), dtype=np.complex_) for i, tau in enumerate(times): shifted_signal = np.roll(x, shift=-tau) product = x * shifted_signal.conjugate() padded_product = np.pad(product, ((nperseg-len(x))//2,), mode=&#39;constant&#39;) convolved_result = np.convolve(padded_product, win[::-1], &#39;same&#39;)[:N] fourier_transform = np.fft.rfft(convolved_result) wvd_matrix[:, i] = fourier_transform return abs(wvd_matrix)**2 ``` 此段代码实现了对输入信号`x`按照指定参数进行SPWVD运算的功能。注意这里的`window`参数允许用户选择不同的窗户形状以适应特定的应用场景需求;而返回的结果是一个二维数组,每一列对应不同延时下的频域响应强度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

发呆的比目鱼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值