A document that the Justice Department says contains secret material on the hydrogen bomb was published yesterday in the Madison, Wis., Press Connection newspaper in a special edition.

Publication occurred one day after a U.S. district judge, at the request of the Justice Department, ordered the Daily California newspaper in Berkeley not to publish the document, a 17-page letter written by Charles Hansen, a computer programmer in Mountain View, Calif. Written Aug. 27, the letter was mailed to a number of politicians and publications.

Last week the Department of Energy put a national security classification on the Hansen letter and on a diagram in it. At DOE's request, the Justice Department sued the Daily California Saturday to prevent publication of Hansen's letter.

"If there were the slightest doubt in the minds of Press Connection editors that theoretical terms and concepts used in the Hansen letter would, upon publication, compromise 'national security' in its original or best sense, we would not publish it," the Madison newspaper said in an accompanying editorial.

"This is the only way the issue could be forced," editorial page editor Dave Wagner said.

The Justice Department had no comment yesterday on the Press Connection's disclosure of the Hansen letter. The department said Saturday that the letter contained "secret restricted information" on the H-bomb, the disclosure of which is prohibited by the Atomic Energy Act of 1954.

Punishment for conviction of violation of the 1954 law includes incarceration and fines.

A larger newspaper, The Chicago Tribune, is telling readers this morning that it intends to publish "appropriate and informative portions" of the Hansen letter on Thursday.

The delay, according to company attorney Don H. Ruben, is intended to give the government time to make a counter-move. If the government truly believes that national security is at stake, Ruben said, it might prefeo to act before publication.

He said The Tribune "is not intimidated by the threat of criminal prosecution."

Ruben called the Hansen letter "newsworthy" and of "great public interest," Tribune publisher Stanton R. Cooke said, the newspaper does not believe that the letter contains "secret information that would jeopardize national security."

Last March the Justice Department was granted an order barring the Progressive magazine from publishing an article by freelance writer Howard Morland called, "The H. Bomb Secret -- How We Got It, Why We're Telling It." That order is being appealed by the magazine, also located in Madison, Wis.

"The Progressive made the mistake of asking permission" to publish Morland's article, Wagner said yesterday.

Among questions facing the Jusice Department as a result of the Press Connection disclosure yesterday are:

Whether to bring criminal or other action against the Madison newspaper even though it was not subject to the injunction pending against the Daily Californian.

Whether the Press Connection has harmed the department's effort to keep in force the injunction pending against the Progressive magazine.

The Press Connection, which was born out of a strike against two large papers in 1977 and says it pays all employees a flat $75 a week, does not ordinarily publish on Sunday. Yesterday's was a special eight-page edition.

Wagner said, "we're hoping to hell" that other U.S. newspapers would publish the Hansen letter "because we're feeling like the Lone Ranger."

In its editorial, the Press Connection said, "This extra edition . . . offers to our readers the complete text of the letter, written by an amateur researcher working with public documents, that was addressed to Illinois Sen. Charles Percy, and which the Daily Californian has just been prevented from printing.

"Now for the first time, Madison readers will be able to judge for themselves the quality and kind of information the government does not want them to see."

In California, Hansen's lawyer, Marcus Topel, said that publication of the letter in The Press Connection "makes the temporary restraining order somewhat academic."

Daily Californian editor Tom Abate called the Press Connection's publication "a very courageous act" and said "the temporary restraining order is obviously meaningless now."

"We're going to move as fast as possible to get it removed," Abate said.

Although Hansen last week turned over to Department of Energy officials all his remaining copies of the letter, it is known that several dozen copies are scattered around the country.

Hansen, in his letter to Percy, says he is "in a unique position to divulte this information to you, in that the staff of the Progressive is muzzled by a court order, and the weapons scientists who know more than I do cannot talk about this subject without risking a violation of their security clearances."

One section of the letter that may have drawn the attention of the Department of Energy described ineight steps how a hydrogen bomb is triggered.

After describing what he calls a "dual trigger design," Hansen wrote:

" . . . a total of eight separate explosions will occur within a matter of a few microseconds, from the instant of the high explosive's detonation to the last gigantic fission explosion of the outer casing."

Like Morland, Hansen wrote that all the material in his letter "has been derived from unclassified open sources."

He has studied affidavits introduced by the government and by Progressive magazine concerning Morland's article, Hansen says, and reached an "inescapable" conclusion: "There must be secret, classified information in the public domain."

He then names three scientists "who had placed it in the public domain and had never been prosecuted for violating the terms of their security clearance."

Moreland, referring to his own article and to the Hansen letter, said yesterday that the government, for the third time, "has violated" its traditional policy of neither confirming nor denying nuclear weapons information "that originates with private citizens."