多用户混合预编码隐蔽通信复现
本帖旨在记录复现论文: Hybrid Beamforming Design for Covert Multicast
mmWave Massive MIMO Communications并对复现的过程记录
疑惑1 一个可用流型解决的问题
min F R J ∥ w ^ J − ( f B J T ⊗ I N t ) vec { F R J } ∥ 2 2 , s.t. ∣ [ F R J ] p , q ∣ = 1 , ∀ p , q , \begin{array}{l} \min _{\boldsymbol{F}_{\mathrm{RJ}}}\left\|\widehat{\boldsymbol{w}}_{\mathrm{J}}-\left(\boldsymbol{f}_{\mathrm{BJ}}^{\mathrm{T}} \otimes \boldsymbol{I}_{N_{\mathrm{t}}}\right) \operatorname{vec}\left\{\boldsymbol{F}_{\mathrm{RJ}}\right\}\right\|_{2}^{2}, \\ \text { s.t. }\left|\left[\boldsymbol{F}_{\mathrm{RJ}}\right]_{p, q}\right|=1, \quad \forall p, q, \end{array} minFRJ w J−(fBJT⊗INt)vec{FRJ} 22, s.t. [FRJ]p,q =1,∀p,q,
so that the Riemannian manifold optimization can be applied to get the solutions.
具体如何去解呢:
求助万能的chatgpt
如果你希望使用 Riemannian manifold optimization 来求解这个问题,你需要使用 MATLAB 的工具箱或库来进行 Riemannian manifold 优化。MATLAB 中有一些库可以帮助你实现这一点,如 Manopt 和 GSPBox(Graph Signal Processing Toolbox)等。
在这里,我将使用 Manopt 来演示如何求解你的问题。首先,确保你已经安装了 Manopt 工具箱。然后,可以使用以下代码框架:
% 定义问题的参数和初始点
n = % 问题维度
X = % 初始点,可能是一个随机初始点
% 设置问题的描述
problem.M = % 选择适当的 Riemannian manifold
problem.cost = @(X) compute_cost(X); % 定义成本函数
problem.egrad = @(X) compute_gradient(X); % 定义梯度函数
problem.ismanopt = true; % 表示使用 Manopt 进行 Riemannian 优化
% 设置优化器选项
options = [];
options.maxiter = % 设置最大迭代次数
options.tolgradnorm = % 设置梯度范数的容忍度
% 使用 Manopt 进行 Riemannian manifold 优化
X_opt = trustregions(problem, X, options);
% 显示结果
% 可视化 X_opt 或根据需要解释优化结果
在上述代码中,你需要定义问题的参数、初始点、成本函数、梯度函数,选择适当的 Riemannian manifold,并设置优化器选项。然后,你可以使用 Manopt 中的 trustregions 函数来执行 Riemannian manifold 优化。最后,你可以可视化优化结果或根据需要进行进一步的分析和解释。
请注意,这只是一个基本的代码框架示例。具体的问题和数据需要根据你的实际情况进行调整和实现。 Manopt 提供了详细的文档和示例,可以帮助你更好地理解如何使用它来进行 Riemannian manifold 优化。
继续求助
原先一直报错的代码
% 设置问题参数
N_t = 10; % N_t 的值,根据你的问题设置
w_hat_J = randn(N_t, 1) + 1i * randn(N_t, 1); % 随机生成 w_hat_J
f_BJ = randn(N_t, 1) + 1i * randn(N_t, 1); % 随机生成 f_BJ
% 初始化 Riemannian manifold 结构
% manifold = grassmanncomplexfactory(1 , N_t * N_t); % 在 Grassmann 流形上执行优化
% manifold = obliquecomplexfactory(N_t * N_t, 1, true);
% complexcirclefactory( N_t * N_t)
manifold = complexcirclefactory( N_t * N_t)
% 定义问题描述
problem.M = manifold;
A = kron(f_BJ.', eye(N_t));
% 定义目标函数3.
problem.cost = @(vecF_RJ) norm(w_hat_J - A * vecF_RJ)^2; % N_t * N_t^2 \times N_t^2 * 1
problem.egrad = @(vecF_RJ) -2*A'*(w_hat_J - A*vecF_RJ);
problem.ehess = @(vecF_RJ, u) 2 * (A' * A) * vecF_RJ - 2 * A' * w_hat_J + 2 * A' * (A * vecF_RJ);
% 设置优化器选项
options.maxiter = 100; % 最大迭代次数
options.tolgradnorm = 1e-6; % 梯度范数的容忍度
% 随机生成初始点
% X0 = problem.M.rand();
% 使用 Manopt 进行 Riemannian manifold 优化
X_opt = trustregions(problem, options);
% 从优化结果中重构 F_RJ
F_RJ_opt = reshape(X_opt, N_t, N_t);
% 显示最优解
disp('Optimal F_RJ:');
disp(F_RJ_opt);
改为正确的代码
% 设置问题参数
N_t = 10; % N_t 的值,根据你的问题设置
w_hat_J = randn(N_t, 1) + 1i * randn(N_t, 1); % 随机生成 w_hat_J
f_BJ = randn(N_t, 1) + 1i * randn(N_t, 1); % 随机生成 f_BJ
% 初始化 Riemannian manifold 结构
manifold = complexcirclefactory(N_t * N_t); % 复单位圆流形
% 定义问题描述
problem.M = manifold;
A = kron(f_BJ.', eye(N_t));
% 定义目标函数
problem.cost = @(vecF_RJ) real((w_hat_J - A * vecF_RJ)' * (w_hat_J - A * vecF_RJ));
% 定义梯度函数
problem.egrad = @(vecF_RJ) -2 * A' * (w_hat_J - A * vecF_RJ);
% 定义Hessian函数
problem.ehess = @(vecF_RJ, u) 2 * A' * A * u;
% 设置优化器选项
options.maxiter = 100; % 最大迭代次数
options.tolgradnorm = 1e-6; % 梯度范数的容忍度
% 随机生成初始点
X0 = problem.M.rand();
% 使用 Manopt 进行 Riemannian manifold 优化
X_opt = trustregions(problem, X0, options);
% 从优化结果中重构 F_RJ
F_RJ_opt = reshape(X_opt, N_t, N_t);
% 显示最优解
disp('Optimal F_RJ:');
disp(F_RJ_opt);