Linda Sue Hamilton, the woman who has lived for several years with Bernard C. Welch, the accused slayer of Washington cardiologist Michael Halberstam, has been granted immunity from prosecution by the U.S. attorney's office here, possibly in return for her testimony against Welch.

Welch's attorney, Sol. Z. Rosen, said he has learned that Hamilton, who has professed not to know anything about Welch's alleged extensive string of burglaries or involvement in the Halberstam murder, has been granted immunity and has already appeared before a D.C. Superior Court grand jury investigating the slaying.

Rosen made the comments yesterday after a hearing before D.C. Superior Court Judge James A. Belson, who declared Welch mentally competent to stand trial on the murder charge.

Belson made his ruling after court-appointed psychiatrist James L. Evans reported that Welch had a rational understanding of the murder charge against him and would be able to assist his lawyer in preparing his defense.

Belson also granted Welch's request for a comprehensive mental examination to determine Welch's state of mind at the time of the shooting on Dec. 5 at Halberstam's Northwest Washington home. Rosen has said Welch probably will plead innocent by reason of insanity. The full forensic examination may delay Welch's trial for up to two months.

Rosen also protested to Belson yesterday that D.C. Jail guards had possibly violated Welch's constitutional rights by shackling and handcuffing him whenever he is taken from his cell. Rosen said the actions were "cruel and barbaric." Belson said he would look into the matter. a

Government prosecutors yesterday refused to comment on Rosen's remarks about immunity for Hamilton. She could not be reached for comment. It also could not be learned if the grant of immunity was in connection with just the Halberstam murder, or also Welch's other alleged criminal activity.

In general, the kind of immunity granted by the U.S. attorney's office here still permits the government to prosecute an individual if law enforcement authorities independently develop information that implicates the individual granted immunity. However, prosecutors would be prevented from using information supplied by Hamilton against her. Such immunity is only granted with the approval of the attorney general and a U.S. District Court judge.

In another Welch-related development, the Justice Department has turned down a request by attorneys representing Elliot Jones, Halberstam's widow, that it sue Welch on her behalf and that of other victims of Welch's alleged criminal activity under a little-used racketeering statute.

According to Martin Lobel, an attorney who said he was acting on behalf of Jones, a request was forwarded to the Justice Department's criminal division through D. Jeffrey Hirschberg, a former justice Department lawyer now in private practice. Hirschberg asked that the department attempt to attach and retain Welch's Great Falls, Va., house as a criminal business "enterprise" for the benefit of Welch's victims.

Although the statute does permit the government to sue an alleged criminal "enterprise" to recover damages, the department concluded that in this case, Welch's house did not fall into that category, according to a Justice Department official who confirmed the request.The department also said it did not want in any way to interfere with its criminal prosecution of Welch.